为什么字典和集合中的顺序是任意的? - Why is the order in dictionaries and sets arbitrary?

问题:

I don't understand how looping over a dictionary or set in python is done by 'arbitrary' order.我不明白循环字典或在 python 中设置是如何按“任意”顺序完成的。

I mean, it's a programming language so everything in the language must be 100% determined, correct?我的意思是,它是一种编程语言,所以语言中的所有内容都必须 100% 确定,对吗? Python must have some kind of algorithm that decides which part of the dictionary or set is chosen, 1st, second and so on. Python 必须有某种算法来决定选择字典或集合的哪一部分,第一、第二等等。

What am I missing?我错过了什么?


解决方案:

参考一: https://en.stackoom.com/question/12x2G
参考二: https://stackoom.com/question/12x2G
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章