Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedpython 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 over

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago