Re: a_list.count(a_callable) ?
- From: Ping <ping.nsr.yeh@xxxxxxxxx>
- Date: Sun, 17 Jun 2007 16:49:23 -0000
print "b has", b.count(25, cmp=le, key=attrgetter("age")), \
"elements with age <= 25."
[deleted]
b has 2 elements with age <= 30.
Oops, I mixed up when copying and pasting at different times... :p
The output was of course
b has 1 elements with age <= 25.
Ping
.
- Follow-Ups:
- References:
- a_list.count(a_callable) ?
- From: Ping
- Re: a_list.count(a_callable) ?
- From: Dustan
- Re: a_list.count(a_callable) ?
- From: Dustan
- Re: a_list.count(a_callable) ?
- From: Carsten Haese
- Re: a_list.count(a_callable) ?
- From: Ping
- Re: a_list.count(a_callable) ?
- From: BJörn Lindqvist
- Re: a_list.count(a_callable) ?
- From: Ping
- Re: a_list.count(a_callable) ?
- From: Wildemar Wildenburger
- Re: a_list.count(a_callable) ?
- From: Dustan
- Re: a_list.count(a_callable) ?
- From: Steven D'Aprano
- Re: a_list.count(a_callable) ?
- From: Ping
- a_list.count(a_callable) ?
- Prev by Date: Re: Function that returns a tuple
- Next by Date: Re: WebThumb
- Previous by thread: Re: a_list.count(a_callable) ?
- Next by thread: A patch to support L.count(value, cmp=None, key=None)
- Index(es):
Relevant Pages
|