List count() Method Syntax

list_name.count(object) 

Parameters: 

  • object: is the item whose count is to be returned.

Returns:  

Returns the count of how many times an object occurs in the list. 

Python List count() method

Python List count() method returns the count of the occurrences of a given element in a list.

Example:

Python3




#create a list
fruits = ["Apple", "Mango", "Banana", "Cherry" , "Papaya"]
# printing count using count() function
print(fruits.count("Apple"))


Output

1

Similar Reads

What is the list count() Method?

...

List count() Method Syntax

list count() function in Python is a built-in function that lets you count the occurrence of an element in a list. It returns the count of how many times an element is present in a list....

How to Use List count() Function

list_name.count(object)...

More Examples on List count() Method

The list count() function is a very easy-to-use function, you just need to call the count() function with the object list and pass the element as a parameter in the function....

Exceptions While Using Python list count() method

...

Practical Application

Let’s discuss some of the examples in different use-cases of count() method....