Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python please Write a function named get_middle_letter_dictionary (sentence) which takes a sentence as a parameter and returns a dictionary where the key is a letter
python please
Write a function named get_middle_letter_dictionary (sentence) which takes a sentence as a parameter and returns a dictionary where the key is a letter and the value is a unique list of words that have the key letter as their middle letter. In case the length of a word is even, take the first of the two potential middle letters as the key letter. You can assume that the sentence is not an empty string. You do not need to worry about sorting the list of words in this question. However, you should convert the entire sentence to lower case before processing. For example: Test Result l hello r world sentence = "hello world" abc_dictionary = get_middle_letter_dictionary( sentence) for key in sorted(abc_dictionary.keys()): print(key, ''.join(sorted (abc_dictionary[key]))) sentence = "Summer is over and the hot days are gone" a days abc_dictionary = get_middle_letter_dictionary(sentence) h the for key in sorted(abc_dictionary.keys()): i is print(key, ''.join( sorted (abc_dictionary [key]))) m summer n and o gone hot r are V overStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started