Home / Python / Reference / Tuple methods

Python tuple count() method

Count how many items equal a value.

Syntax

tuple.count(value)

Tuples only have two methods, because they cannot change.

Parameters

valuewhat to count

Return value

int

Example

Code

rolls = (6, 2, 6, 3, 6)
print(rolls.count(6))

Output

3

Related

Learn it step by step in the free lesson Lists & Tuples, with exercises that check your answers.