+ 1
In Dictionaries in Pyhon, key value 1 and 0 will create confusion if another key values are "True" or "False"
pairs = {1: "apple", "orange": [2, 3, 4], False: True, True: False, #None: "True", } print(pairs.get(1)) #here output will be "false" insted of "apple"
1 Antwort
0
Yeah that will happen...
But using boolean expressions as keys is rare, and of course not appreciable