MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / morseToEnglish

Function morseToEnglish

src/gamesbyexample/morsecode.py:71–77  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

69
70
71def morseToEnglish(message):
72 message = message.split(' ')
73 english = [] # Make a list of English letters from the morse code.
74 for code in message:
75 if code in MORSE_TO_ENGLISH:
76 english.append(MORSE_TO_ENGLISH[code])
77 return ''.join(english)
78
79
80# If the program is run (instead of imported), run the game:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected