query on Python list comprehension : <p>I tried:</p>

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

<p>this works fine:</p>

<pre><code>&gt;&gt;&gt; for q in a:
...     print(q)
... 
0
1
2
3
4
</code></pre>

<p>But, if I try to change the (mutable) list objects like so, it doesn't work:</p>

<pre><code>&gt;&gt;&gt; for q in a:
...     q = 0
... 
&gt;&gt;&gt; a
[0, 1, 2, 3, 4]
</code></pre>

<p>It seems to me that each time through the loop, q refers to a[n], as n ranges from 0 to 4.  So, it would seem, setting q = 0 ought to make the list all value zero.</p>

<p>Any suggestions that are quite Pythonic?</p>
