python的collection系列-counter
一、计数器(counter)Counter是对字典类型的补充,用于追踪值的出现次数。具备字典的所有功能 + 自己的功能。1 import collections2 aa = collections.Counter("sdfdsgsdf;sdfssfd") #把所有元素出现的次数统计下来了3 print(aa)4 5 输出结果:6 Counter({'s':...