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
| value | what 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.