I am struggling to see if there exist a way in order to access a python dictionary with strings as keys with the correct string but case insensitive
For example with this code:
dictionary = {'one': 1, 'two': 2, 'three', 3} list = ['One', 'second', 'THree'] for item in list: if item in dictionary: print(item) I am not able to find a way such that the output is: `One THree', ie. to compare the keys of the dictionary and the string that I have case insenstively
Is there a way to do that?
defaultdictand modify the getter. But think about this: if you have the keysoneandONE, then what value would you like to get withOne?