You are going to create a simple Mad Lib generator. A Mad Lib is a word game using a short story where certain elements of the story are intentionally left missing. Each missing element is identified with a part of speech, such as noun, verb, adjective, etc. and to be filled in by the reader. For example:
Yesterday [proper noun 1] decided to read a book about [plural noun] because they were feeling [emotion]. [proper noun 1] put on their [clothing item] went to the [place] to relax with their book.
Inserting random words based on the categories above, we might have a story like:
Yesterday Mary decided to read a book about computers because they were feeling anxious. Mary put on their hat went to the park to relax with their book.
This exercise is designed to introduce you to:
cs102
folder, create a folder named ex02
for this assignment<untitled>
)
madlib.py
and save it in your ex02
folderYou will write a short Mad Lib story (two to three sentences) that requires at least five pieces of information to complete the story. The information will be stored in five separate variables, merged into a coherent story via a Python f-string, and displayed using the print function. You can use information repeatedly in the story so it makes sense (e.g. like using Mary’s name twice in the example above), but each of the five variables should hold unique information (e.g. don’t do food1, food2, etc.). Make sure to name your variables such that people know what type of information to insert into the respective position within your story (e.g. noun, name, food, verb, etc.).
Right click your assignment folder and choose compress
on MacOS or Compress to ZIP file
on Windows. Upload the zip file to the matching Moodle assignment to submit your work.
You will earn up to 3 points for this exercise, broken down as follows: