[Tutor] Re: [Edu-sig] style question

Kirby Urner urnerk@qwest.net
Wed, 20 Feb 2002 15:50:44 -0800


>
>What's better is to get the length of the list where the value is true.
>
>how_many_evens = len( filter(lambda i, i%2==0, testlist) )
>
>   -Arcege

As yet, I don't get the real difference between getting the
length by filtering on i%2==0, and adding the 1s in
reduce(add,[i%2==0 for i in testlist]).  I'm missing some
subtle point.

Kirby