python return list count by x 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 the number of times a value appears in python
The count of i is: 2
The count of p is: 0