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