Answer to Question #326531 in Python for Yola

Question #326531
7)Write a Python program to count the number of characters (character frequency) in a string. without using function
1
Expert's answer
2022-04-10T05:24:49-0400
string = input("enter string: ")
d = {}
for s in string:
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
print(d)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS