python foorlop counter code example
Example 1: python for enumerate loop
>>> values = ["a","b","c"]
>>> for count, value in enumerate(values):
... print(count, value)
...
0 a
1 b
2 c
Example 2: python for loop get iteration number
for idx, item in enumerate(list):
print(item)
print('Iteration number: ', idx)