1MyList = ["a", "b", "a", "c", "c", "a", "c"]
2
3return my_dict = {i:MyList.count(i) for i in MyList}
4# returns :
5{'a': 3, 'c': 3, 'b': 1}
6 # OR
7from collections import Counter
8return my_dict = dict(Counter(MyList))
9# returns :
10{'a': 3, 'c': 3, 'b': 1}
11# the both returns the same so it's up to you to choose the one you prefere ;)