Morse Code Encoder Decoder | Python

Published: 13 February 2021
on channel: Indian Tech
1,381
16

Python program to implement Morse Code Translator.
'cipher' - 'stores the Morse translated form of the English string'
'decipher' - 'stores the English translated form of the Morse string'
'citext' - 'stores Morse code of a single character'
'i' - 'keeps count of the spaces between Morse characters'
'message' - 'stores the string to be encoded or decoded'

MORSE_CODE_DICT = { 'A':'.-', 'B':'-...',
'C':'-.-.', 'D':'-..', 'E':'.',
'F':'..-.', 'G':'--.', 'H':'....',
'I':'..', 'J':'.---', 'K':'-.-',
'L':'.-..', 'M':'--', 'N':'-.',
'O':'---', 'P':'.--.', 'Q':'--.-',
'R':'.-.', 'S':'...', 'T':'-',
'U':'..-', 'V':'...-', 'W':'.--',
'X':'-..-', 'Y':'-.--', 'Z':'--..',
'1':'.----', '2':'..---', '3':'...--',
'4':'....-', '5':'.....', '6':'-....',
'7':'--...', '8':'---..', '9':'----.',
'0':'-----', ', ':'--..--', '.':'.-.-.-',
'?':'..--..', '/':'-..-.', '-':'-....-',
'(':'-.--.', ')':'-.--.-'}

Stay tuned till next time.
Happy coding.
As always code is on GitHub:
https://github.com/ultimus11/morse-co...
  / sahil43463216  
  / sahil_panindre  
Have a look at my python 21 days beginner to advance series on following Instagram handle:
  / indian__tech__  


On this page of the site you can watch the video online Morse Code Encoder Decoder | Python with a duration of online in good quality, which was uploaded by the user Indian Tech 13 February 2021, share the link with friends and acquaintances, this video has already been watched 1,381 times on youtube and it was liked by 16 viewers. Enjoy your viewing!