Why dictionary values aren't in the inserted order?

前端 未结 6 852
野的像风
野的像风 2020-12-19 02:37

When i declare a list 1,2,3,4 and i do something with it , even just print i get back the same sequence 1,2,3,4.

But when i do anything with dictionaries , they alw

6条回答
  •  梦毁少年i
    2020-12-19 02:43

    Dictionaries are unsorted. This is well-documented. Do not rely on the ordering of dictionaries.

提交回复
热议问题