As I know, python dictionary is an unordered datastructure. But when it comes to that I insert a key-value pairs into dictionary and traverse it. Surprisedly find it outputs each orderedly.Why ? Use python3.6 .
Asked
Active
Viewed 56 times
2
-
Coincidence. The order is not guaranteed. – Code-Apprentice Feb 14 '18 at 16:51
-
Happy accident. Don't rely on it – SuperStew Feb 14 '18 at 16:52
-
1@Code-Apprentice Not true in Python 3.6 – Alex Feb 14 '18 at 16:52
-
It is *not* an accident in Python 3.6 (at least, not when using the CPython interpreter). – chepner Feb 14 '18 at 16:53