Contact: aviboots(AT)netvision.net.il
40,770 questions
53,152 answers
573 users
from collections import Counter counter = Counter() for ch in "python pro": counter[ch] += 1 print(dict(counter.items())) ''' run: {'p': 2, 'y': 1, 't': 1, 'h': 1, 'o': 2, 'n': 1, ' ': 1, 'r': 1} '''