ordereddict有序字典
生活随笔
收集整理的这篇文章主要介绍了
ordereddict有序字典
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
import collections as con# 有序添加和取字典元素
ord = con.OrderedDict()
ord['a'] = 1
ord['b'] = 2
ord['c'] = 3
print(ord, 'ordereddict')# 移动某元素到最后
ord.move_to_end('a')
print(ord, 'move_to_end')
转载于:https://www.cnblogs.com/xh4528/p/6538700.html
总结
以上是生活随笔为你收集整理的ordereddict有序字典的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 【Python】 子进程创建与使用sub
- 下一篇: Problem B: 字符类的封装