from collections import OrderedDict
# 使用dict存储键值对
d = {'b': 2, 'a': 1, 'c': 3}
for key, value in d.items():
print(key, value)
# 输出:
# b 2
# a 1
# c 3
# 使用OrderedDict存储键值对
od = OrderedDict([('b', 2), ('a', 1), ('c', 3)])
for key, value in od.items():
print(key, value)
# 输出:
# b 2
# a 1
# c 3