0
20kviews
Write a Python program to count the number of characters (character frequency) in a string.
1 Answer
0
7.4kviews

Explanation:-

  • Take a string as a input from the user.
  • Create a empty dictionary.
  • Iterate over the character in the string check if the char is the present in the dictionary if yes then increment the value of the corresponding key if not then create a key.
  • Print the dictionary …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.