+ 1
print(pairs) apple??????
3 Answers
+ 3
Dictionary keys must be unique. When a new value is added to the dictionary, Python first checks if the key already exists, and if it does, the value of the existing key is overwritten. This happens here:
1: "apple",
...
True: False,
Because True is evaluated to 1 so the apple is overwritten by False.
For this reason, it is usually not great to mix different types of data as keys in the same dictionary, particularly int and bool have this conflict.
0
SERG Starkov whats your question . I donât get it. Even aftet looking at your code.
Dictionary is an unordered sequnce of elements.
0
Look inside code. Section """ Why