title: for loop with 2 iterators and 2 ranges
body: <p>I am a newbie of Python and dealing with a prime generator. The algorithm i wanna use is <a href="http://en.wikipedia.org/wiki/Sieve_of_Atkin" rel="nofollow">Sieve of Atkin</a>.</p>
  
  <p>At this moment, I am trying to follow the pseudo code of the algorithm as my practice. However, I have faced a problem and I can't find any reference about it. (Maybe I am not good at searching...). In the pseudo code, <code>for (x, y) in [1, √limit] × [1, √limit]:...</code> makes me confused. I know what it means but don't know how to translate this code into Python code. </p>
  
  <p>Sorry if my question is not appropriate, and thanks for the help. :)</p>
  
  <p>Below is a part of my code.</p>
  
  <pre><code>itx = iter(range(1, int(limit**0.5)))
  ity = iter(range(1, int(limit**0.5)))
  for x, y in zip(itx, ity):
      n = 4*(x**2)+(y**2)
      if n &lt;= limit and (n%12 == 1 or n%12 == 5):
          sieve[n] = not sieve[n]
  
      n = 3*(x**2)+(y**2)
      if n &lt;= limit and n%12 == 7:
          sieve[n] = not sieve[n]
  
      n = 3*(x**2)-(y**2)
      if x &gt; y and n &lt;= limit and n%12 == 11:
          sieve[n] = not sieve[n]
  
      itx.next()
      ity.next()
  </code></pre>