[0, 0, 0, 1, 1, 1, 0] ... remove all 0 values

Daniel Austria futurebase at gmx.at
Wed Jul 8 16:44:37 CEST 2009


Hi python - hackers,

just one question. How can i remove all 0 values in a list? Sure - i
can loop over it, but that s not a neat style.  list.remove() will
only remove the first occurence. Doing that while no exception is
raised is also uncool, right?

Some suggestions?


Best,
Dan



More information about the Python-list mailing list