Loop Through An Array In Python With An Index
items = ["a", "b", "c", "d", "e"]
for index, item in enumerate(items):
print(index, item)
Output:
0 a
1 b
2 c
3 d
4 e
-- end of line --
items = ["a", "b", "c", "d", "e"]
for index, item in enumerate(items):
print(index, item)
0 a
1 b
2 c
3 d
4 e