
#NANO MORSE DECODER CODE#
Remember that we chose to use a dictionary structure to store our Morse Code representation in Python, where each alphabet or number is represented by a series of ‘0’s and ‘1’s.

This is the essential method for object creation and it usually initialize the values of the instance variables of each object. We will build a class called Decoder and it will contain several methods, with the first being _init_(self). A simple explanation about Python class is that it defines a set of instance variables (data values to be represented for each object) and a set of methods (operations) that can be applied to the objects. One major difference between this decoder and the previous one is that we will be using Python class to build our decoder and the respective analysis checks. Furthermore, we can implement checks in the decoder to inform us of the frequencies in which each alphabet/number, word, or sentence type have been decoded. In this post, we will improve our simple Morse Code Decoder to be able to decipher sentences as well.

Image by author - Python output of Simple Morse Code Decoder
