title: reliable to read loop variable after loop in Python
body: <p>Is it safe to read loop variable after loop (using Python 2)? My purpose is to check how many iterations in the loop are done.</p>
  
  <p>Here is code to show the idea:</p>
  
  <pre><code>a=[1,2,3,4,5]
  
  for i in range(len(a)):
      if a[i] == 2:
          break
  
  print i # output is 1, is it safe to read i here?
  </code></pre>