Question: Define a function named create_consonant_dictionary(words) which takes a list of words as a parameter. The function returns a dictionary where the keys are consonants in

Define a function named create_consonant_dictionary(words) which takes a list of words as a parameter. The function returns a dictionary where the keys are consonants in lowercase and the corresponding values are the list of word lengths for all words in the list that start with that consonant. The lists of numbers must be in sorted ascending order. Note: you can assume there will be no punctuation characters in the parameter list (i.e. only letters) and the list is not empty. You should convert all words to lower case.

For example:

Test Result
words = ['Technology', 'affects', 'the', 'way', 'teachers', 'teach', 'and', 'students', 'learn', 'sacculus'] a_dict = create_consonant_dictionary(words) for key in sorted(a_dict.keys()): print(key, a_dict[key])
l [5] s [8, 8] t [3, 5, 8, 10] w [3] 

Answer:(penalty regime: 0 %)

1

2

3

def create_consonant_dictionary(words):

consonants = "bcdfghjklmnpqrstvwxyz"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!