Question
Write a module named randStr.py that has 3 functions. Each function has an optional second parameter to set a particular seed. 1) randWord accepts a
Write a module named randStr.py that has 3 functions. Each function has an optional second parameter to set a particular seed.
1) randWord accepts a string and will return a random word from that string (return value is string). 2) strMixer will randomly change words inside the string and returns a string -- If the string is only one word, then it will mix the letters of the word and return the mixed word as a string 3) randIntForWord accepts a word and then returns a random integer between 0 and 100,000; the same word should return the same random integer.
Import the 3 functions in the main file and call each of them 5 times (with and without seed).
If the module is called directly, print the following message: "Sorry, but this module can only be imported!"
code needed in Python V3.x
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