Morse Code Encoder Decoder | Python

Veröffentlicht am: 13 Februar 2021
auf dem Kanal: 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__  


Auf dieser Seite können Sie das Online-Video Morse Code Encoder Decoder | Python mit der Dauer online in guter Qualität ansehen, das der Benutzer Indian Tech 13 Februar 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,381 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!