2-6如何让字典保持有序
摘要:
1、实现方法 Dict字典是无序的,collections模块下的OrderedDict是有序的字典,OrderedDict的Key会按照插入的顺序排列,不是Key本身排序: 测试本例方法: from collections import OrderedDict from time import t 阅读全文
posted @ 2018-04-02 11:27 石中玉smulngy 阅读(200) 评论(0) 推荐(0)
浙公网安备 33010602011771号