List Question

Michael Bentley michael at jedimindworks.com
Tue Oct 2 17:22:44 EDT 2007


On Oct 2, 2007, at 2:06 PM, brad wrote:

> How is this expressed in Python?
>
> If x is in y more than three times:
>      print x
>
> y is a Python list.

# Try using help -- help(list) or help(list.count) for instance...
if y.count(x) > 3:
     print x




More information about the Python-list mailing list