Home >>Python List Methods >Python List count() Method
Python list count() method is used to return the number of element present in the given input list with the specified value.
Syntax:list.count(value)
Parameter | Description |
---|---|
value | This is a required parameter. It defines the value to search for. |
fruits = ["Abhi", "Alpha", "Jerry"]
x = fruits.count("Jerry")
print(x)
fruits = [1, 4, 2, 9, 8, 5, 4, 7, 8, 7, 8, 9, 3, 1, 8]
x = fruits.count(8)
print(x)