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')
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')