Oct-25-2021, 09:24 PM
(Oct-25-2021, 09:10 PM)bowlofred Wrote: Your function reads the data not intomorse_text
but intomroz_text
. Probably a typo?
def decode(mroz_text: str) -> str: morse_array = morse_text.split("/")
Yes, and I also changed plaintext to plain_text but now i have there
Traceback (most recent call last):
File "C:/Users/dokipo/Desktop/pythonprojects/alphabet.py", line 29, in <module>
print(decode(encode("This is first testing sentence.")))
File "C:/Users/dokipo/Desktop/pythonprojects/alphabet.py", line 25, in <module>
plain_text += morse[current_element]
builtins.KeyError: 't'
What´s wrong with "t"?