Home >>Python Tuple Methods >Python Tuple count() Method
Python count() method is used to return the number of times a specified value appears in the given input tuple.
Syntax:tuple.count(value)
Parameter | Description |
---|---|
value | This is a required parameter. It defines the item to search for. |
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5)
x = thistuple.count(5)
print(x)
a = ['Abhi', 'Mickey', 'Jerry', 'Abhi', 'Cobra', 'Alpha', 'Abhi']
X = a.count("Abhi")
print(X)