Question
Instructions : Write a program madlibs.py to automatically generate madlibs stories. Your main() function should define lists of ~25 words for each different type of
Instructions: Write a program madlibs.py to automatically generate madlibs stories. Your main() function should define lists of ~25 words for each different type of wordslot in the story below (a list of persons, a list of places, a list of plural nouns, a list of action verbs, a list of foods, a list of adjectives, etc.). Then it should call a function to display the story. The function selects a random word from the appropriate list for every word-slot, and displays the story with those words filled into the blanks. After the program prints one version of the story, main() should ask if the user wants to see another version of the story. If the user enters "y" or "Y" or "yes" or "Yes" or "YES", the program prints another version of the story, using different randomly selected words. If the user enters "n" or "N" or "no" or "No" or "NO", the program stops. If the user enters an invalid response, the program displays "Please answer 'y' or 'yes' or 'n' or 'no'." and asks again if the user wants to see another version of the story.
Last summer, we went for a vacation with ______ (person name) on a trip to _____ (place). The weather there is very ______ (adjective)! Northern ______(same place) has many _____ (plural noun), and they make _____ (plural noun) there. Many people there also go to the _____ (different place) to _____(action verb). The people who live there like to eat _____ (food). They also like to _____ (action verb) in the sun and swim in the _____ (noun). It was a really _____ (adjective) trip!
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