how to find how many times something occurs in a list code example
Example 1: how to find the number of times a number appears in python
dict((i, a.count(i)) for i in a)
Example 2: count occurrences of value in array python
>>> l = ["a","b","b"]
>>> l.count("a")