I seem to recall there is a built-in way of doing this:
i = 0
for value in values:
# ...Stuff
i += 1
but in a neater syntax; something like
for value, i in fn(values):
# ...Stuff
Is my memory correct; and if so, what is the way of doing this?