python---统计列表中数字出现的次数

1 import collections
2 
3 a = [1,2,3,1,2,3,4,1,2,5,4,6,7,7,8,9,6,2,23,4,2,1,5,6,7,8,2]
4 b = collections.Counter(a)
5 for c in b:
print c,b[c]
原文地址:https://www.cnblogs.com/lxs1314/p/7236321.html