= "Janet"
person_one = "Loopdydoo Avenue"
street_name = "Richard"
person_two = "Christmas tree"
object_name = "Horse-drawn carriage"
vehicle = "Off-road"
adjective = create_story(person_one, street_name, person_two, \
story
object_name, vehicle, adjective)print(story)
Programming Project 1
Programming Projects are to be submitted to gradescope.
Due date: Sep 12, Thursday at 7pm
In this PA, you will be writing two simple programs that print out text. Note that this programming project is relatively straightforward. Not all of the future assignments will be this way. It is simple because we have not yet covered a wide variety of programming concepts, so there’s only so much I can reasonably expect you to be able to program. The programming projects will get more challenging, but also, hopefully, more interesting!
Make sure you follow the provided style guide (you will be graded on it!). You are not allowed to use any built-in method or function for any Python library.
Also make sure you check the Academic Integrity and Common Gradescope Errors pages.
Mad Libs
Mad Libs is a simple game/activity where the host player prompts other participant(s) for words of various types. For instance, the host might ask the other participants for various words that fall into categories such as nouns, places, names, verbs, etc. These words are filled in to blanks in a story, and after the host has gotten all of the words filled in, the story is read aloud. For instance, here is a printable mad lib from madlibs.com.
In this programming exercise, you’ll write two mad lib program, that act as the host of the game. The program will take as argument various strings (words), and then it will return a single string with a story using these words.
Move Mad Lib
The first program should be named move.py
. The outline of the story is shown below:
??? decided to move from their apartment on 5th to a condo on ???. They called their friend ??? for help. However, they could not fit ??? into the moving truck, so they had to rent a ??? ??? in order to move it!
The locations with ???
indicate that these should be replaced with a word specified by the computer user. Your create_story
function should take 6 arguments, and fill them in to the story. An example of running the program would look like so:
Janet decided to move from their apartment on 5th to a condo on Loopdydoo Avenue. They called their friend Richard for help. However, they could not fit Christmas tree into the moving truck, so they had to rent a Off-road Horse-drawn carriage in order to move it!
Vacation Mad Lib
The second program should be named vacation.py
. The outline of the story is shown below:
??? and ??? were best friends. One day ??? and ??? decided to go on a vacation to ???. However, they didn't know what to do with their ??? pet ??? named ???. ??? had been causing problems, due to constant ???ing. ??? found a sitter for their pet, and ??? went on the trip.
Again, locations with ???
indicate that these should be replaced with a word specified by the computer user. Your create_story
function should take 8 arguments. An example of running the program would look like so:
def main():
= "Joe"
person_one = "Lily"
person_two = "Poncho"
pet_name = "polar bear"
animal = "Madagascar"
place = "Ridiculous"
adjective = "plank"
verb = "spastically"
adverb = create_story(person_one, person_two, pet_name, \
story
animal, place, adjective, verb, adverb)print(story)
main()
Joe and Lily were best friends. One day Joe and Lily decided to go on a vacation to Madagascar. However, they didn't know what to do with their Ridiculous pet polar bear named Poncho. Poncho had been causing problems, due to constant planking. Joe found a sitter for their pet, and spastically went on the trip.