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__
На этой странице сайта вы можете посмотреть видео онлайн Morse Code Encoder Decoder | Python длительностью online в хорошем качестве, которое загрузил пользователь Indian Tech 13 Февраль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,381 раз и оно понравилось 16 зрителям. Приятного просмотра!