擅长:python、mysql、java
<pre><code>>>> from collections import Counter
>>> Counter([1,1,1,2])
Counter({1: 3, 2: 1})
</code></pre>
<p><a href="http://docs.python.org/3.1/library/collections.html#collections.Counter" rel="noreferrer">Counter</a>仅在py3.1中可用,继承自<code>dict</code>。在</p>