标签: python python-2.7
如果:
for k in ['a', 'b', 'c', 'd']: print k a b c d
然后为什么在创建有序字典顺序时会有所不同:
from collections import OrderedDict OrderedDict({k: k for k in ['a','b','c','d']}) OrderedDict([('a', 'a'), ('c', 'c'), ('b', 'b'), ('d', 'd')])