Created
May 28, 2015 02:40
-
-
Save dvl/50cb6c1a886151dec04d to your computer and use it in GitHub Desktop.
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
alphabet = { | |
".-": "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", | |
"/": " ", | |
} | |
phrase = '.... . .-.. .-.. --- / -.. .- .. .-.. -.-- / .--. .-. --- --. .-. .- -- -- . .-. / --. --- --- -.. / .-.. ..- -.-. -.- / --- -. / - .... . / -.-. .... .- .-.. .-.. . -. --. . ... / - --- -.. .- -.--' | |
print ''.join(alphabet.get(letter) for letter in phrase.split()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment