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

Friðrik Már Jónsson fridrik at pyth.net
Wed Jul 8 12:44:47 EDT 2009

J Kenneth King wrote:
> I was wondering when someone would mention filter()

I was happy to see that too.

It's clean, faster than list comprehension and in terms of clarity  
it's only to be expected that the developer is familiar with, or at  
least willing to look up, the available built-in methods.

Friðrik Már

More information about the Python-list mailing list