ordereddict有序字典
生活随笔
收集整理的這篇文章主要介紹了
ordereddict有序字典
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
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
- 下一篇: 每天一个LINUX命令(pwd)