Python Tuple count() Method
Example
Return Value: The number of times 5 appears in the tuple:
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5) x = thistuple.count(5) print(x)
Definition and Usage
The count() method returns the number of times the specified value appears in the tuple.
Syntax
tuple.count(value)
Parameter Value
Parameter | Seconds |
---|---|
value | Required. The items to be retrieved. |