d =dict([('a',1),('b',2),('c',3)])
d # dict的Key是无序的>>>{'a':1,'c':3,'b':2}
od = OrderedDict([('a',1),('b',2),('c',3)])>>> OrderedDict([(‘a’,1),(‘b’,2),(‘c’,3)])
Counter: 计数器
>>>from collections import Counter
>>> c = Counter()>>>for ch in'programming':... c[ch]= c[ch]+1...>>> c
Counter({'g':2,'m':2,'r':2,'a':1,'i':1,'o':1,'n':1,'p':1})