from collections import OrderedDict
d = OrderedDict()
d['one'] =(1,35)
d['two']=(2,37)
d['three']=(3,38)
print(d)
python3 如何让字典保持有序
最新推荐文章于 2024-04-21 16:55:23 发布
from collections import OrderedDict
d = OrderedDict()
d['one'] =(1,35)
d['two']=(2,37)
d['three']=(3,38)
print(d)