["python","python-2.7"]
Python: count repeated elements in the list

I am new to Python. I am trying to find a simple way of getting a count of the number of elements repeated in a list e.g. MyList = ["a", "b", "a", "c", "c", "a", "c"] Output: a: 3 b: 1 c: 3
You can do that using count: my_dict = {i:MyList.count(i) for i in MyList} >>> print my_dict #or print(my_dict) in python-3.x {'a': 3, 'c': 3, 'b': 1} Or using collections.Counter: from collections import Counter a = dict(Counter(MyList)) >>> print a #or print(a) in python-3.x {'a': 3, 'c': 3, 'b': 1}