x = input()
freq={}
for i in x:
    if i in freq:
        freq[i]+=1
    else:
        freq[i]=1
print(freq)

注意在Python中字符串是可迭代的字符向量