Thanks for the insight. I saw the behavious as soon as I extended x
with a bunch of 0's

>>> x = list(range(10))
>>> x.extend([0]*10)
>>> x
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>> for i in reversed(x):
        if i % 2 == 0:
                x.remove(i)

>>> x
[1, 3, 5, 7, 9]

>>> x = list(range(10))
>>> x.extend([0]*10)
>>> x
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>> for i in x:
        if i % 2 == 0:
                x.remove(i)


>>> x
[1, 3, 5, 7, 9, 0, 0, 0, 0, 0]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to