If we want to know how many times an object is present in list List.count feature is used.
b=[‘apple’, ‘orange’, ‘mango’, ‘guavava’, ‘apple’]
To count how many times apple present in list
b.count(‘apple’)
Output:2
It will raise value error when element does not present in list.
[…] List.count: To count an elment or object occurence in […]