擅长:python、mysql、java
<p>这段代码可能会有所帮助,计数器字典将数字作为键,数字出现作为值。在</p>
<pre><code>from random import randint
counter = {}
while i < 1000000:
RandomNumber = (randint(0,6))
if RandomNumber in counter:
counter[RandomNumber] += 1
else:
counter[RandomNumber] = 1
i += 1
</code></pre>