i have this list:
[\'Boston Americans\', \'New York Giants\', \'Chicago White Sox\', \'Chicago Cubs\', \'Chicago Cubs\', \'Pittsburgh Pirates\', \'Philadelph
Try this:
new_list = ['a', 'b', 'a'] new_dict = {} for i in new_list: new_dict[i]=new_list.count(i) print(new_dict) Result - {'a': 2, 'b': 1}