Question: Using the random module, write a function (random_words) which receives a string containing text to analyze, and generates a random sample of 'n' words from

Using the "random" module, write a function ("random_words") which receives a string containing text to analyze, and generates a random sample of 'n' words from Frankenstein (assume that a space (' ') is used to separate words). Your word list should be of 100 distinct (non-repeating), lower case words, and you may want to use the functionality provided by the "set" data type to help with this.

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