title: Query regarding local and global variables in Python
body: <p>I am a beginner in Python. Please see the below code:</p>
  
  <pre><code>for line in range(8):
      fact = 1
  print(fact)
  </code></pre>
  
  <p>I received output as <code>1</code></p>
  
  <p>My query is since <code>fact</code> variable is withing the scope of for loop, how does Python access the variable outside it's scope. Thank in advance.</p>