Why can't I use the integers 0 or 1 as a key in a dictionary with the function get(), when I use a boolean as another key?
When I use a boolean True or False as a key, I get as an output the value of this key when I put the integers 0 or 1 into the function get, even if I have one key named as the intenger 1 or 0. 0(integer) is regard to False(Boolean) and 1(integer) is regard to True (Boolean) as keys in a dictionary. In the example bellow, when I remove the pair with the boolean key (True:False), I can take the value "apple" of the key 1. So I can't access the keys 0/1 when I have a correspondent boolean as a key. Example: pairs = {1: "apple", "orange": [2, 3, 4], True: False, 12: "True", } print(pairs.get("orange")) #output >>> [2,3,4] print(pairs.get(7, 42)) #output >>> 42 print(pairs.get(12345, "not found")) #output >>> not found print(pairs.get(1)) #output >>> False