how to quickly count how much of a certain element is 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 values in list usiing counter
from collections import Counter