Answer:
from collections import defaultdict #importing defaultdict
low_d=defaultdict(int)#declaring an empty dictionary
string=str(input("Enter your string \\"))#taking input of the string...
for i in string:#iterating over the string..
low_d[str.lower(i)] += 1 #adding the character in lowercase and increasing it's count..
for key,value in low_d.items():#iterating over the dictionary.
print(key+":"+str(value))#printing the key value pair..
Output:-
Enter your string
ramaranR
n:1
m:1
a:3
r:3
Step-by-step explanation:
I have declared an empty dictionary using defaultdict then I have ask the user to input the string.Then I iterated over the string and added each character to the dictionary and updated it's count.Then printing the characters and their frequency.