I did a list comprehension with
result =[df_dict[letter] for letter in user_input]
this works aslong the letter is a key in df_dict. Now i tried to catch exceptions, but i cant figure out how i pass the latter if a Key Error occurs if I wanna use a list comprehension.
This is the solution i found so far.
result =[]
for letter in user_input:
try:
result.append(df_dict[letter])
except KeyError:
pass