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?
for i, value in enumerate(values):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With