count

Description

Returns the number of times the specified item appears in the list.

Syntax

list. count(item)

item
Required. Any valid type.

Return Value

int

Time Complexity

#TODO

Example

>>> [1, 1, 2].count(1)
2
>>> [1, 1, 2].count(2)
1
>>> [1, 1, 2].count(5)
0

See Also

`min()`_, `max()`_ and `len()`_ functions, `in`_ statement