相关疑难解决方法(0)

Python字典中的项目排序

我很怀疑...我创建了以下字典:

>>> alpha={'a': 10, 'b': 5, 'c': 11}
Run Code Online (Sandbox Code Playgroud)

但是,当我想看到我得到的字典键和值时:

>>> alpha
{'a': 10, 'c': 11, 'b': 5}
Run Code Online (Sandbox Code Playgroud)

看到"b"和"c"交换了他们的位置.如何使位置与创建字典时的位置相同?

python dictionary

5
推荐指数
1
解决办法
564
查看次数

标签 统计

dictionary ×1

python ×1