Re: Another question about pythonic syntax, yea!
@24, this is not correct. Running this in my python environment:
>>> x = [1, 2, 3, 4, 5, 6, 7]
>>> for item in x:
... if item != 3:
... x.remove(item)
...
>>> x
[2, 3, 5, 7]
if I use your other list (x = [1, 2, 3, 3, 4, 5]):
>>> x = [1, 2, 3, 3, 4, 5]
>>> for item in x:
... if item != 3:
... x.remove(item)
...
>>> x
[2, 3, 3, 5]
Case in point: all items are checked against all conditions and branches in the loop unless continue or break is executed in one of the conditional branches and that particular branches condition happens to be true.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector