Just a quick question. Let’s say we have a list like this:
food = [(1, 'cheese'), (2, 'mushrooms'), (2, 'mushrooms'), (2, 'pepperoni'), (3, 'sausage'), (6, 'pineapple'), (7, 'anchovies')]
How to find the number of (2, ‘mushrooms’) in this list?
As far as I know, the count() method only takes one argument. Therefore, I need to know if there is another way that we can count the element in question?