May-11-2018, 02:03 PM
You are modifying the list on the go during the for loop. This is not a good idea. I admit that I am unable to see what is going on looking at the script.
If you want to play with the index you can use enumerate.
If you want to play with the index you can use enumerate.
for index, element in enumerate([4,3,2,1,0]): print(index + 1, element)
Output:1 4
2 3
3 2
4 1
5 0