Question: IN PYTHON Read in a list of names, past tense verbs and fruits and randomly create sentences. Run the I/O to see how the output
IN PYTHON
Read in a list of names, past tense verbs and fruits and randomly create sentences. Run the I/O to see how the output should be displayed.
# PLACE ANY NEEDED IMPORT import random
# END OF IMPORT STATEMENTS
# DEFINE YOUR FUNCTIONS (NOT INCLUDING MAIN) IN THIS SECTION # END OF FUNCTION DEFINITIONS
# MAIN PART OF THE PROGRAM -- DON'T CHANGE ANYTHING IN MAIN! def main(): seed = int(input()) print("The seed is", seed) names,verbs,fruit = getData() print("NAMES:", names) print("VERBS:", verbs) print("FRUIT:", fruit) random.seed(seed) for i in range(10): n = pick(names, random.randint(1,1000)) v = pick(verbs, random.randint(1,1000)) f = pick(fruit, random.randint(1,1000)) print(n,v,"the",f) # INCLUDE THE FOLLOWING 2 LINES, BUT NOTHING ELSE BETWEEN HERE if __name__ == "__main__": main() # AND HERE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
