Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alphamorse = {'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':'--..', ' ':' '}
- myText = input('Enter a string of letters: ')
- morseText = ''
- for character in myText:
- morseText += alphamorse[character]
- morseText += ' '
- print(morseText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement