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

Function englishToMorse

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

Source from the content-addressed store, hash-verified

61
62
63def englishToMorse(message):
64 morse = [] # Make a list of each letter's morse code.
65 for character in message:
66 if character in ENGLISH_TO_MORSE:
67 morse.append(ENGLISH_TO_MORSE[character])
68 return ' '.join(morse)
69
70
71def morseToEnglish(message):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected