count how many times a value shows in python list

#use count():
>>> my_list = [1, 2, 3, 1, 4]
>>> print(my_list.count(1))
2

#OR, you can also use counter:
>>> from collections import Counter
>>> z = ['blue', 'red', 'blue', 'yellow', 'blue', 'red']
>>> Counter(z)
Counter({'blue': 3, 'red': 2, 'yellow': 1})

Here is what the above code is Doing:
1. We import the Counter class from the collections module.
2. We create a list of colors.
3. We create a Counter object that contains the number of times each color appears in the list.