Efficient way to develop a dictionary for reverse lookup?
Let’s say I have a dictionary with the following contents: old_dict = {‘a’:[0,1,2], ‘b’:[1,2,3]} and I want to obtain a new dictionary where the keys are the values in the old dictionary, and the new values are the keys from the old dictionary, i.e.: new_dict = {0:[‘a’], 1:[‘a’,’b’], 2:[‘a’,’b’], 3:[‘b’]} To perform this task, I’m… Read More Efficient way to develop a dictionary for reverse lookup?