Here's the solution:
def char_frequency(text):
freq = {}
for char in text:
freq[char] = freq.get(char, 0) + 1
return freq
print(char_frequency("hello"))
# {'h': 1, 'e': 1, 'l': 2, 'o': 1}
Same pattern as counting words. The string is just another iterable.