I was creating 'sieve of eratosthenes' in python and i found using 'remove' while operating 'for' loop removes only odd numbers (or even index element).
I thought it would remove all things in 'arr' list, removing its elements itself.
Can Anyone explain this?
Here is the Code
arr = list(range(1, 11))
for i in arr:
arr.remove(i)
print(arr)
p.s. Sorry for bad gramma.