擅长:python、mysql、java
<p>你对字典有一些重大的概念误解。python中的字典就像<a href="https://en.wikipedia.org/wiki/Hash_table" rel="nofollow">hash table</a>,哈希表没有顺序。dict的输出实际上是依赖于环境的,所以不能依赖于环境。您可能会看到输出的一种方式,而其他人会看到另一种方式。您应该考虑改用<a href="https://docs.python.org/2/library/collections.html#collections.OrderedDict" rel="nofollow">^{<cd1>}</a>。你知道吗</p>