7)Write a Python program to count the number of characters (character frequency) in a string. without using function
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?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment