count occurences in array python code example
Example 1: count occurrences of value in array python
>>> l = ["a","b","b"]
>>> l.count("a")
Example 2: python count occurrences of an item in a list
>>> [1, 2, 3, 4, 1, 4, 1].count(1)
3
>>> l = ["a","b","b"]
>>> l.count("a")
>>> [1, 2, 3, 4, 1, 4, 1].count(1)
3