python 字典有序

来源:互联网 发布:网络语66是什么意思 编辑:程序博客网 时间:2024/05/29 04:54

按照存放顺序

自定字典时则

date_container=collections.OrderedDict()


按照key大小顺序(若要按照value,则t[1])date_container=collections.OrderedDict(sorted(date_container.items(),key=lambda t:t[0]))

0 0