Last active
October 29, 2019 19:29
-
-
Save clarerocks2007/5a36c43a1c1d0fbf813780f5d6100a06 to your computer and use it in GitHub Desktop.
How to Type Morse Code In Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code= {'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': '--..', | |
'0': '-----', '1': '.----', | |
'2': '..---', | |
'3': '...--', '4': '....-', '5': '.....', | |
'6': '-....', '7': '--...', '8': '---..', | |
'9': '----.', ' ':'new word ' } | |
morseCode=input("Type something in all caps, and I'll convert it to Morse code(I welcome numbers as well):" ) | |
for character in morseCode: | |
print(code[character]) |
Author
clarerocks2007
commented
Oct 29, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment