Question: Write a python program that includes the following: count(): function that takes a string as a parameter, and returns a dictionary where the keys
Write a python program that includes the following:
• count(): function that takes a string as a parameter, and returns a dictionary where the keys are the unique letters in the string, and the values are the counts. Note: spaces should not be included in the dictionary.
• find_ch_most(): function that takes a dictionary as a parameter and returns the character in the dictionary with the highest count. • Write a script that inputs a sentence from the user and using the functions above displays the character with the highest count.
Sample Run: Enter a sentence:hello how are you today? Character "o"has occurred the most in "hello how are you today? "
Step by Step Solution
3.34 Rating (148 Votes )
There are 3 Steps involved in it
To achieve the task described in the question we will write a Python program with two functions count and findchmost We will then use these functions ... View full answer
Get step-by-step solutions from verified subject matter experts
