+ 4
Explain
can anyone explain me this? print({True:"yes",1:"no",1.0:"Maybe"}) output: {True: 'Maybe'}
2 Respuestas
+ 5
For a dictionary, True, 1 and 1.0 are actually the same thing.
So key 1 is overwritten two times and gets stuck at value 'Maybe'.
The dict has only one item.
- 1
maybe