Python counts the number of list items
Counting List Items in Python The count() method in the list class returns the number of times a given object appears in the list. Syntax list.count(obj) Return Value The number of times an object appears. The count() method returns an…