Python Tuple count() Method Syntax

Syntax: tuple.count( ele )

Parameters:

  • ele: Any element whose occurrence we want to calculate.

Return: The number of times the elements appears in the tuple.

Python Tuple count() Method

In this article, we will learn about the count() method used for tuples in Python. The count() method of a Tuple returns the number of times the given element appears in the tuple.

Example

Python3




tuple = (1, 2, 3, 1, 2, 3, 1, 2, 3)
print(tuple.count(3))


Output :

3

Similar Reads

Python Tuple count() Method Syntax

...

Tuple count() Method in Python Examples

Syntax: tuple.count( ele ) Parameters: ele: Any element whose occurrence we want to calculate. Return: The number of times the elements appears in the tuple....

Contact Us