>>> text = 'eujiyghkiuyhjiu'
>>> from collections import Counter
>>> Counter(text)
Counter({'u': 3, 'i': 3, 'h': 2, 'j': 2, 'y': 2, 'e': 1, 'k': 1, 'g': 1})
from collections import defaultdict
def_dic = defaultdict(int)
for c in text:
def_dic[c] += 1