Python Referenced For Loop
<p>I'm playing with <code>for</code> loops in Python and trying to get used to the way they handle variables.</p>

<p>Take the following piece for code:</p>

<pre><code>a=[1,2,3,4,5]
b=a
b[0]=6
</code></pre>

<p>After doing this, the zeroth element of both <code>b</code> and <code>a</code> should be <code>6</code>. The <code>=</code> sign points a reference at the array, yes?</p>

<p>Now, I take a <code>for</code> loop:</p>

<pre><code>a=[1,2,3,4,5]
for i in a:
    i=6
</code></pre>

<p>My expectation would be that every element of <code>a</code> is now <code>6</code>, because I would imagine that <code>i</code> points to the elements in <code>a</code> rather than copying them; however, this doesn't seem to be the case.</p>

<p>Clarification would be appreciated, thanks!</p>
