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 i within it in each loop run? Like some sort of finally for a for loop?
for i, data in enumerate(somevar):
    # do something
# get what i was when for loop completed here??
 
     
    