Re: Another question about pythonic syntax, yea!
@24, this is not correct. Running this in my python environment:
>>> 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 and/or break is executed in one of the conditional branches.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector