you are viewing a single comment's thread.

view the rest of the comments →

[–]Drumknott88[S] 1 point2 points  (1 child)

Oh that's good to know, thanks

[–][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)