蓝桥 python笔记5——Counter、deque、defaultdict、OrderedDict
目录Counter:计数器deque:双端队列defaultdict:有默认值的字典OrderedDict:有序字典Counter:计数器之前不用Counter需要这样写:a=["apple","banana","apple","cat","cat","cat","dog"]#通过字典来存储b={}forxina:b[x]=b.get(x,0)+1#b[x]改valueprint(b)#{'app