Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Write a function to do the following

Write a function to do the following

Computer Science

Write a function to do the following. It will accept a string of words from the user. The program should then create a dictionary where the key is a letter in the alphabet and the value is a list of all words beginning with that letter. For example, if the input is the string 'heavy, duty,light,mean,median,mode,hers,home, long', the output should be the following dictionary { h':['heavy', 'hers', 'home'], 'd':[duty], 'I':['light', 'long'], 'm':['mean', 'median', 'mode']} Ask the user to provide a list and then call the function to print out the dictionary. Note: Enter a string without the quotes and with the words separated by a comma. Assume that the user may also enter spaces. So you must remove any leading and trailing spaces in each word. (base) python listOfFirstHil301.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE