4. Read a multi-digit number(as chars) from the console.
Develop a program to print the
frequency of each digit with suitable message.
message=input('Enter your input:')
count=[ ]
for character in message:
[Link] (character, 0)
count[character]=count [character]+1
print('frequency of words appeared in the sentence or paragraph') print(count)
for k,v in [Link]():
print('character'+' '+str(k)+' '+' appeared'+str(v)+' '+'times')
Output
Enter your input: 123123123123123456784567845678
frequency of words appeared in the sentence or paragraph
{'1': 5, '2': 5, '3': 5, '4': 3, '5': 3, '6': 3, '7': 3, '8': 3}
character 1 appeared 5 times
character 2 appeared 5 times
character 3 appeared 5 times
character 4 appeared 3 times
character 5 appeared 3 times
character 6 appeared 3 times
character 7 appeared 3 times
character 8 appeared 3 times