Oct-25-2021, 09:43 PM
KeyError
means that you tried to reference a key from a dictionary that didn't exist.In this case it means that
morse
didn't have a key of "t" at the time you referenced it. You create it as an empty dictionary, but never seem to change it afterward. Is it necessary? Is it supposed to be translation_dict?