Try the following:
a = [i for in range(10000)] if 9999 in a: print('yay I just looped over an entire array')
however:
a = {i:i for in range(10000)} if 9999 in a: print('yay I found a key in linear time')
Now, You might be an expert in Data Structures, but what makes you implicitly know how the 'IN' behaves in python, and that it won't convert to the keys() method of the dict to get a list with the same behaviour as in a list?