list subsetting

bearophileHUGS at bearophileHUGS at
Wed Jan 21 23:12:20 CET 2009

> a.count(3.14)

If the values to count are approximated FP values, then you may need
something more complex, like:

leniter(ifilter(somefunction, a))

Where somefunction uses an approximated comparison, and leniter is
just a function that counts the items of a generic iterator.


More information about the Python-list mailing list