Let\'s say I have a list of tuples l, and I do something like this:
for (a,b) in l: do something with a,b, and the index of (a,b) in l
Use enumerate.
for i, (a, b) in enumerate(l): # i will be the index of (a, b) in l