I want to get even indexed numbers from the python list here is my code snippet:
for i in array:
if array.index(i) % 2 == 0:
print(str(i) + " >> index: " + str(array.index(i)))
The list I am providing is as below:
-37,-36,-19,-99,29,20,3,-7,-64,84,36,62,26,-76,55,-24,84,49,-65,41
But in output its not showing me the number 84
having index 16
even is it divisible by 2
Why is it omitting the index 16
also sometimes I'm getting odd index and even indexes both!