title: Get count of iterations after for loop is completed
body: <p>In a python for loop, how do I get the value of i below when the loop is completed? Is there any idiomatic way to do that without defining a variable outside and loop and storing <code>i</code> within it in each loop run? Like some sort of <code>finally</code> for a for loop?</p>
  
  <pre><code>for i, data in enumerate(somevar):
      # do something
  # get what i was when for loop completed here??
  </code></pre>