title: Python list initialization in for loop
body: <p>How do initialize a list in a for loop:</p>
  
  <pre><code>for x, y in zip(list_x, list_y):
       x = f(x, y)
  </code></pre>
  
  <p>unfortunately, this loop does not alter list_x even though I want it to.</p>
  
  <p>Is there a way to have references to the elements of list_x in the loop?</p>
  
  <p>I realize I could use a list comprehension, but that's hard to read when <strong>the for loop is very complicated</strong>.</p>
  
  <p>Edit: My <code>for</code> loop is 20 lines.  Would you normally put 20 lines into a single list comprehension?</p>