title: Iterating and for function - Python
body: <p>I can't seem to get my head around this. I would appreciate some help. It looks to me like the for function is iterating at a rate of n+1 for every new iteration, although I can't figure out why. </p>
  
  <p>Here is my Python code:</p>
  
  <pre><code>for n in range(2, 10):
      print "This is %d" % n
      for x in range(2, n):
          print "%d" % n
  </code></pre>
  
  <p>And here is the output in Powershell:</p>
  
  <pre><code>This is 2
  This is 3
  3
  This is 4
  4
  4
  This is 5
  5
  5
  5
  This is 6
  6
  6
  6
  6
  This is 7
  7
  7
  7
  7
  7
  This is 8
  8
  8
  8
  8
  8
  8
  This is 9
  9
  9
  9
  9
  9
  9
  9
  </code></pre>
  
  <p>Why is this happening?</p>