title: About variable scope?
body: <p>I had a math test today and one of the extra credit questions on the test was</p>
  
  <pre><code>product = 1
  for i in range(1,7,2):
      print i
      product = product * i
  print i
  print product
  </code></pre>
  
  <p>We were supposed to list out the steps of the loop which was easy; but it got me thinking, why does this program run?  the second <code>print i</code> seems out of place to me.  I would think that the <code>i</code> only exists for the for loop and then get's destroyed so when you call the second <code>print i</code> there is no variable <code>i</code> and you get an error.  </p>
  
  <p>Why does <code>i</code> remain a global variable?</p>