Question: Get Jokes for a Long Word from the Plot DescriptionNow you'll define a function called get _ jokes. It will extract the longest word from

Get Jokes for a Long Word from the Plot DescriptionNow you'll define a function called get_jokes. It will extract the longest word from the plot and try to find jokes for it. If there aren't any, it will proceed to the next longest word, and so on, until it finds a word for which there are jokes. If there is more than one word of the same length, try words that are earlier in the description first (which sorted does by default, since it's "stable" and will only move things around the minimum necessary).We provide code that removes punctuation from the words in plot and assigns the result to the variable words. Your code should extend this by sorting words from longest to shortest and use the sorted list (and the get_joke_data function that you defined above) to find the longest word with associated jokes. If there are no words with associated jokes, your function should return the tuple (None, None). If there is a word with associated jokes, your function should return a tuple with (1) the longest word with a joke and (2) a list of jokes associated with that word (as a list of strings).

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 Programming Questions!