I'm using for loop which should run to the number of items in the given list. instead for some reason it is skipping every adjacent element.
snakes = [50, 23, 45, 67, 82]
ran = 0
for x, snake in enumerate (snakes):
z = 0
print("ran : ", ran)
ran +=1
while snake in snakes:
z += 1
if z == snake:
print(x, snake)
snakes.pop(x)
output
ran : 0
0 50
ran : 1
1 45
ran : 2
2 82