def char_frequency(str1):
    freq = {}
    for ch in str1:
        freq[ch] = freq.get(ch, 0) + 1
    return freq