title: Changing iteration variable inside for loop in Python
body: <p>I am trying to do something as simple as changing the varible in which I am iterating over (i) but I am getting different behaviours in both Python and C.</p>
  
  <p>In Python,</p>
  
  <pre><code>for i in range(10):
      print i,
      if i == 2:
          i = 4;
  </code></pre>
  
  <p>I get <code>0 1 2 3 4 5 6 7 8 9</code>, but the equivalent in C:</p>
  
  <pre><code>int i;
  for (i = 0; i &lt; 10; i++) {
      printf("%d", i);
      if (i == 2)
          i = 4;
  }
  </code></pre>
  
  <p>I get <code>01256789</code> (note that numbers 3 and 4 don't appear, as expected).</p>
  
  <p>What's happening here?</p>