@@ -0,0 +1,1223 @@
+morseAlphabet = %7B%0A    %22A%22: %22.-%22,%0A    %22B%22: %22-...%22,%0A    %22C%22: %22-.-.%22,%0A    %22D%22: %22-..%22,%0A    %22E%22: %22.%22,%0A    %22F%22: %22..-.%22,%0A    %22G%22: %22--.%22,%0A    %22H%22: %22....%22,%0A    %22I%22: %22..%22,%0A    %22J%22: %22.---%22,%0A    %22K%22: %22-.-%22,%0A    %22L%22: %22.-..%22,%0A    %22M%22: %22--%22,%0A    %22N%22: %22-.%22,%0A    %22O%22: %22---%22,%0A    %22P%22: %22.--.%22,%0A    %22Q%22: %22--.-%22,%0A    %22R%22: %22.-.%22,%0A    %22S%22: %22...%22,%0A    %22T%22: %22-%22,%0A    %22U%22: %22..-%22,%0A    %22V%22: %22...-%22,%0A    %22W%22: %22.--%22,%0A    %22X%22: %22-..-%22,%0A    %22Y%22: %22-.--%22,%0A    %22Z%22: %22--..%22,%0A    %22 %22: %22/%22%0A%7D%0A%0AinverseMorseAlphabet = dict((v, k) for (k, v) in morseAlphabet.items())%0A%0AtestCode = %22-- --- .-. ... . / ..-. .. -. --. . .-. ... / - ..- .-. -. / - --- / - .-- .. - - . .-. / ..-. .. -. --. . .-. ...%22%0A%0A%0A# parse a morse code string%0Adef decode_morse(code):%0A    decoded = ''%0A    words = code.split('/')%0A    for word in words:%0A        letters = word.strip().split(' ')%0A        for letter in letters:%0A            decoded += inverseMorseAlphabet%5Bletter%5D%0A        decoded += ' '%0A    return decoded%0A%0A%0A# encode a message in morse code, spaces between words are represented by '/'%0Adef encode_to_morse(message):%0A    encoded_message = %22%22%0A    for char in message:%0A        encoded_message += morseAlphabet%5Bchar.upper()%5D + %22 %22%0A%0A    return encoded_message%0A%0Aprint(decode_morse(testCode))

Add morse translator