ReferenceList methods
list.count()
How many items equal the value.
Signature
items.count(value)Parameters
| Name | Means |
|---|---|
value | what to count |
Returns
An int.
Example
Python
print([10, 20, 10].count(10))
print([10, 20].count(99))Output
2 0
Basics
Strings
Collections
Functions
Classes and objects
Modules and the standard library
Files and errors
Beyond the basics
ReferenceList methods
How many items equal the value.
items.count(value)| Name | Means |
|---|---|
value | what to count |
An int.
print([10, 20, 10].count(10))
print([10, 20].count(99))Output
2 0