Change value of currently iterated element in list in python
<p>problem:
when you use construction</p>

<blockquote>
  <p>for a in <em>list</em>:
      print a</p>
</blockquote>

<p>it prints every item in array. But you can't alter array. Is it possible to alter value of array (something like a=123, but that ain't working)
I know it's possible (for example in while loop), but I want to do it this way (more elegant)</p>

<p>In PHP it would be like</p>

<blockquote>
  <p>foreach ($array as &amp;$value) 
      { $value = 123 ;}</p>
</blockquote>

<p>(because of &amp; sign, is passed as reference)
thanks</p>
