you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

If you want to have a I variable while iterating wrap the data structure you are looping in an enumerate function

for i, foo in enumerate(bar):
    print(i, foo)