Chapters
Python114 chapters

ReferenceTuple methods

tuple.count()

How many items of a tuple equal the value. One of only two tuple methods.

Signature

values.count(item)

Parameters

NameMeans
itemwhat to count

Returns

An int.

Example

Python
values = (1, 2, 2, 3)
print(values.count(2))

Output

2

See also