How can I count the occurrences of a list item?

If you only want one item’s count, use the count method: Important Note regarding count performance Don’t use this if you want to count multiple items. Calling count in a loop requires a separate pass over the list for every count call, which can be catastrophic for performance. If you want to count all items, or even just multiple items, use Counter, … Read more