0

Help with my program

Im trying to make a "translator" in python for morse code, Ive defined the characters, but it only works when the input is an individual character(a). Any help?

16th Apr 2017, 4:34 PM
Onii Chan
Onii Chan - avatar
4 Answers
+ 7
Without code, we can't help you create anything. You're trying to ask for us to do it all, before you have even put a small effort into doing it yourself.
16th Apr 2017, 6:16 PM
SoraKatadzuma
SoraKatadzuma - avatar
+ 6
Pls post your code or make it public for anyone to view.
16th Apr 2017, 5:23 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 6
This should work seamlessly for letter-only strings (words). Try adding an empty space, interpunction signs and digits for better usability.
16th Apr 2017, 10:01 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
The only thing im asking for is possible issues, already cleared up what ive done. sorry for the late reply though, was pretty busy. my code: . .: 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': '--..', } msg = input('Enter your message') for char in msg: print (CODE[char.upper()])
16th Apr 2017, 9:34 PM
Onii Chan
Onii Chan - avatar