Web Analytics

Python list.count() Method

List Method โ€ข Count

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

Related Functions