Question: Plzz do fast 2. Write a function called character_map that takes a string called string as its only argument, then it creates a map called
Plzz do fast

2. Write a function called character_map that takes a string called string as its only argument, then it creates a map called char_count where the keys are the characters in the string and the values are the number of times that character appears in the string. The function must return char_count. (60 points) Get a string form the user and call the character_map function on that string. Store the map that is returned by the function in a variable called char_count and print that variable. Then use char_count to store the most frequent character of the string in a variable called most_freq_char and print that variable. (Note that you can only use the map for finding the most frequent character so DON'T go through the string again!) - If there are several characters that have the same frequency, you can print any of them! a) Use the count() function on the string to help you create the map. b) Do NOT use the count() function on the string. Sample string: 'University of Delaware' Sample output: The character map: {'U': 1, 'n': 1, ': 2, 'V': 1, 'e': 3, 'r': 2, 's': 1, 't': 1, 'y': 1,'': 2, 'o': 1, 'f': 1, 'D': 1, 1:1, 'w': 1, 'a': 1} The most frequent character: e
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
