Question: Question 13 (20 points) Write a function named importantwords that analyzes a text string for words that meet a length threshold. Any word shorter than

 Question 13 (20 points) Write a function named importantwords that analyzes

Question 13 (20 points) Write a function named importantwords that analyzes a text string for words that meet a length threshold. Any word shorter than this threshold is considered unimportant and is ignored The function importantwords takes two parameters: . a string s that contains only lower case letters and white space (no punctuation marks or other special characters) an int threshold that is the minimum length of a word that is considered important Output. Return a dictionary in which each key k is a word in s that is at least threshold characters long. The value corresponding to k is the number of occurrences of k in s For example, if importantwords is called by these lines: lyric "'a time to build up a time to break down a time to dance a time to mourn" print (importantwords(lyric, 4)) then the following would be correct output 'mourn 1, 'build': 1, 'down': 1, 'dance': 1, 'time': 4, break' 1 Page 6 of6

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!