I have a list of arrays that I am iterating over with python, so the head of my loop looks like:
for item in my_long_list:
do_something
My problem is that I want to save the iteration number, so that info can be extracted from another array, something like:
for item in my_long_list:
do_something
grab_values(another_long_list[i])
where i is he iteration number that the loop is going through at that moment.
I thought about doing a nested loop like:
for i in list(range(1,len(my_long_list)):
for item in my_long_list:
do_something
grab_values(another_long_list[i])
but it repeats i for each one of the items, when in reality what I want is one single iteration number per item in my long list.
So is there a way to "store" the iteration number and use it within the loop with python?