擅长:python、mysql、java
<p>您可以将所有输入串联起来以获得一个字符串,并将其与<code>collections.Counter()</code>一起使用</p>
<pre><code>import collections
ct = collections.Counter("1234567890123475431234")
ct['3'] == 4
ct.most_common() # gives a list of tuples, ordered by times of occurrence
</code></pre>