Anyone knows why output key 1: is not 'apple' | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Anyone knows why output key 1: is not 'apple'

pairs = {1: "apple", "orange": [2, 3, 4], True: False, None: "True", } print(pairs) Output: {1: False, 'orange': [2, 3, 4], None: 'True'}

1st Dec 2020, 5:29 AM
Jingyi Zhao
Jingyi Zhao - avatar
1 Answer
+ 4
maybe because True: False evaluate to 1: False, replacing 1: "Apple" that come before
1st Dec 2020, 5:37 AM
Rei
Rei - avatar