Daniel Austria wrote:

> 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.

Why not? If you need to potentially look at *all* elements of a list,
nothing but a loop will take you there.

OTOH, your proposed "remove until nothing is found"-thingy will become
quadratic in behavior, as remove also loops over the list - so if you have
list with say 10 ones followed by 10 zeros, you will loop ten times for 11
elements, which is in the order of (n/2)**2.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to