title: List Comprehension output different than nested for loops?
body: <p>I really am at a loss as to why this list comprehension is generating different output to what I thought the equivalent with nested for loops. Can anyone shed any insight?</p>
  
  <p>The list comprehension:</p>
  
  <pre><code>[(n ** 5, m ** 3) for n in range(3) for m in range(5) if m % 2 == 0]
  </code></pre>
  
  <p>Results in the following:</p>
  
  <pre><code>[(0, 0), (0, 8), (0, 64), (1, 0), (1, 8), (1, 64), (32, 0), (32, 8), (32, 64)]
  </code></pre>
  
  <p>However, what I believe is the equivalent nested For loop:</p>
  
  <pre><code>L = []
  for n in range(3):
      for m in range(5):
          if m % 2 == 0:
              n = n**5
              m = m**3
              vals = (n,m)
              L.append(vals)
  L
  </code></pre>
  
  <p>Results in the following:</p>
  
  <pre><code>[(0, 0),
   (0, 8),
   (0, 64),
   (1, 0),
   (1, 8),
   (1, 64),
   (32, 0),
   (33554432, 8),
   (42535295865117307932921825928971026432, 64)]
  </code></pre>
  
  <p>Why is there a difference in the output between the two?</p>