+ 1

Why code is showing output like this? Info in the code

https://code.sololearn.com/cBgJslz8TjQk/?ref=app

9th Oct 2017, 2:06 AM
Adhyayan
Adhyayan - avatar
2 Answers
+ 1
As opposed to lists, dictionaries make no guarantees whatsoever regarding the order of its elements. If you care about order, you use lists. The fact that they are reordered is simply because Python is using an underlying structure behind the scenes which reorganizes its elements to optimize various operations on the dictionary.
10th Oct 2017, 5:45 AM
Chinmoy
Chinmoy - avatar
+ 1
Thanks Chinmoy
10th Oct 2017, 6:21 AM
Adhyayan
Adhyayan - avatar