In the first page of dictionary functions, why does 8:64 come before the rest in the squares example? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In the first page of dictionary functions, why does 8:64 come before the rest in the squares example?

26th Dec 2016, 3:02 PM
Siva Chakravarti
Siva Chakravarti - avatar
4 Answers
+ 7
The newest version of Python indeed introduces ordered dictionaries as a new class. However, standard dictionaries are still unordered. The output when printing is performance-optimized and stable within an execution (if unmodified). For standard dictionaries order is irrelevant, though.
6th Feb 2017, 6:31 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
I think that is because order is not always preserved in Python 3.5's dictionaries (but it is in the brand new Python 3.6)
26th Dec 2016, 4:32 PM
Amaras A
Amaras A - avatar
0
OrderdDict is available in the collections module since Python 2, I think. The order in standard dict is still not guaranteed, but it is more often ordered than in 3.5. That's not a new class, just a new implementation
11th Feb 2017, 8:02 PM
Amaras A
Amaras A - avatar
- 5
Plz play meebo plz and thx
26th Dec 2016, 6:34 PM
hackingmaster
hackingmaster  - avatar