Write a python program to count number of each characters in a string
For example python
P=1,y=1,t=1,h=1,o=1,n=1
inputString=input("Enter a string: ")
freq = {}
for i in inputString:
if i in freq:
freq[i] += 1
else:
freq[i] = 1
print (str(freq))
Comments
Leave a comment