擅长:python、mysql、java
<p>如果你只需要数数<code>func_names</code>和<code>results</code>,就用<a href="https://docs.python.org/2/library/collections.html#collections.Counter" rel="nofollow">Counter</a></p>
<pre><code>import collections
stats = collections.Counter()
def add_result_to_stats(result,func_name):
stats.update({(func_name, result):1})
</code></pre>