Question: Write a function named initialD that takes in a parameter called text, a string containing words, and returns a new dictionary where each key is
Write a function named initialD that takes in a parameter called text, a string containing words, and returns a new dictionary where each key is the first letter of a word in text and the corresponding value is a list containing each word beginning with that letter (duplicates allowed). Upper and lower case letters are considered different from each other. def initialoi d= I) for word in initial = If Initial not in d: d) initia1]= else: at initial l.append (word) return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
