Daniel Austria <futureb...@gmx.at> writes:
> just one question. How can i remove all 0 values in a list? 

I prefer:

   newlist = list(x for x in oldlist if x != 0)

to the square bracket list comprehension that a few people have
suggested.  This is because in python 2.x, the listcomp "leaks" its
index variable into the surrounding scope, but the generator
expression above doesn't.  Usually not a big deal, but an extra bit of
hygiene never(?) hurts.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to