how to get the index of list during iteration code example
Example: get index of list item in loop
ints = [1,2,3,4,'5','6']
for idx, val in enumerate(ints):
print(idx, val)
#Output
0 1
1 2
2 3
3 4
4 '5'
5 '6'
ints = [1,2,3,4,'5','6']
for idx, val in enumerate(ints):
print(idx, val)
#Output
0 1
1 2
2 3
3 4
4 '5'
5 '6'