I tried:
a = [0,1, 2, 3, 4, 5]
this works fine:
>>> for q in a:
... print(q)
...
0
1
2
3
4
But, if I try to change the (mutable) list objects like so, it doesn't work:
>>> for q in a:
... q = 0
...
>>> a
[0, 1, 2, 3, 4]
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.
Any suggestions that are quite Pythonic?