Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started