Dictionary or list?
<p>I need to be able to store data, one being a number and one being the number of times it appeared. I have a for loop that calls a method that returns a dictionary:</p>

<pre><code>for x in range(total_holidays):
    t = trial()
    y = y + "\n" + str(x+1) + "," + str(t["brown"]) + "," + str(t["rainbow"]) + "," + str(t["nothing"]) + "," + str(t["days"])
    total += t["days"]
    #print total
    if x%10000 == 0:
        y0.append(y)
        y = ""
</code></pre>

<p>Basically I need to count how many times t['days'] happens, the number changes almost every time. If you want the full code look here: </p>

<p><a href="http://math.stackexchange.com/questions/193846/how-many-trials-would-you-expect-to-give-you-an-accurate-answer">http://math.stackexchange.com/questions/193846/how-many-trials-would-you-expect-to-give-you-an-accurate-answer</a></p>

<p>So how would I do this and then I need to print it all out after.</p>

<p><code>y</code> is text for a csv file, and total is used to calculate the average. </p>

<hr>

<p>As suggested by mgilson should I use this?</p>

<pre><code>from collections import Counter

a = []
for x in range(total_holidays):
    t = trial()
    y = y + "\n" + str(x+1) + "," + str(t["brown"]) + "," + str(t["rainbow"]) + "," + str(t["nothing"]) + "," + str(t["days"])
    total += t["days"]
    a.append(t['days'])
    #print total
    if x%10000 == 0:
        y0.append(y)
        y = ""
z = Counter(a)
print z
</code></pre>

<p>Should I have something like that?</p>
