python for loops and variables
<p>My first question, sorry if i've made a mistake or this has been answered before, I couldn't find it anyway.</p>

<p>Here's a generic version of my code:</p>

<pre><code>count = 0
classlist = []
for i in xrange(0,100):
    if random.random() &lt; 0.5:
        var_1 = 1
    else:
        var_1 = 2
    count += 5

    classlist.append(Class(var_1,count))
</code></pre>

<p>My problem is that after this loop has run, every instance of class has the final value of count (5*100 = 500 in this example).</p>

<p>How can I create a list of class instances with different values of count?</p>

<p>EDIT: indentation was correct.</p>
