Morse Code — it is a method of transmitting textual information in the form of a sequence of tones, lights or clicks that can be understood by an experienced listener or observer without special equipment. It is named after Samuel FB Morse, the inventor of the telegraph.
The algorithm is very simple. Every character in English is replaced by a series of "dots" and "dashes", and sometimes just single "dots" or "dashes" and vice versa.
Please refer to this Wikipedia image for details.
Python provides a data structure called dictionary, which stores information as key-value pairs, which is very handy for implementing a cipher like Morse code. We can store the Morse code in a dictionary where (key-value pairs) = & gt; (English characters — Morse code) . The plaintext (English characters) replaces the keys, and the ciphertext (Morse code) forms the values of the corresponding keys. Key values can be accessed from a dictionary in the same way we access array values through their index and vice versa.