In this program, we will take a string as input and calculate the frequency of each character in a string.
Steps to solve the program
- Take a string as input and create an empty dictionary.
- Use For loop to iterate over each character in the string.
- Add the character as a key in the dictionary and its count in the string as its value.
- Use count() to count how many times a character has appeared in the string.
- Print the output.
Output :