numbers = [1,2,3,4,5]
for counter, item in enumerate (numbers):
if (counter % 2 == 0):
print (item)
print(counter)
numbers = [1,2,3,4,5]
for counter, item in enumerate (numbers):
print("counter",counter," item",item," counter % 2=",counter % 2)
if (counter % 2 == 0):
print (item)
print("print(counter)",counter)
counter 0 item 1 counter % 2= 0
1
counter 1 item 2 counter % 2= 1
counter 2 item 3 counter % 2= 0
3
counter 3 item 4 counter % 2= 1
counter 4 item 5 counter % 2= 0
5
print(counter) 4