Python list.count() Method
The count() method returns the number of elements with the
specified value.
Syntax
list.count(value)
Parameters
| Parameter | Description |
|---|---|
value |
Required. Any type (string, number, list, tuple, etc.). The value to search for. |
Return Value
An integer, the number of occurrences of the value.
Example
Using the count() method:
Output
Click Run to execute your code
Enjoying these tutorials?