test_str=input("Enter any string") freq={} for i in test_str: if i in freq: freq[i]+=1 else: freq[i]=1 print("Count of all character in:", test_str , "is:\n "+str(freq))