Chapters
Python114 chapters

ReferenceList methods

list.count()

How many items equal the value.

Signature

items.count(value)

Parameters

NameMeans
valuewhat to count

Returns

An int.

Example

Python
print([10, 20, 10].count(10))
print([10, 20].count(99))

Output

2
0

See also