title: How does a list in a for loop work in Python?
body: <p>So I have this code:</p>
  <pre><code>def function(b):
     a = []
     for i in range(0,len(b),2)
         a.append(b[i])
     return a
  
  def main():
     a = [0,1,2,3,4,5,6,7,8,9,10,11]
     for i in[51,&quot;a&quot;, 3.2]
        a = function(a)
     print a
  main()
  </code></pre>
  <p>I don't understand how the for loop works with the list <code>[51, &quot;a&quot;, 3.2]</code>, and why with that list it prints <code>[0, 8]</code>, but with the list<code>[51, &quot;a&quot;]</code> prints <code>[0,4,8]</code>.</p>