I created the following dictionary
exDict = {True: 0, False: 1, 1: \'a\', 2: \'b\'}
and when I print exDict.keys(), well, it g
exDict.keys()
Python take the 1 as True. And the Boolean type is a subtype of the integer type
True
In [1]: a = {} In [2]: a[True] = 0 In [3]: 1 in a.keys() Out[3]: True