100% found this document useful (1 vote)
2K views1 page

2.17 LAB Input Mad Lib

The document describes a mad libs activity where a program prompts the user for various words through input and uses those words to complete and output a short story. It provides an example where the user inputs a first name, location, number, and plural noun, and the program outputs a sentence using those inputs to tell a silly story. The goal of the lab activity is to write a Python program that takes various user inputs and outputs a completed mad libs story using those inputs.

Uploaded by

CHRIS D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views1 page

2.17 LAB Input Mad Lib

The document describes a mad libs activity where a program prompts the user for various words through input and uses those words to complete and output a short story. It provides an example where the user inputs a first name, location, number, and plural noun, and the program outputs a sentence using those inputs to tell a silly story. The goal of the lab activity is to write a Python program that takes various user inputs and outputs a completed mad libs story using those inputs.

Uploaded by

CHRIS D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

2.

17 LAB: Input: Mad Lib


Mad Libs are activities that have a person provide various words, which are then used to
complete a short story in unexpected (and hopefully funny) ways.
Complete the program to read the needed values from input, that the existing output statement(s)
can use to output a short story.
Ex: If the input is:
Eric
Chipotle
12
cars
Then the output is:
Eric went to Chipotle to buy 12 different types of cars
LAB ACTIVITY
2.17.1: LAB: Input: Mad Lib
10 / 10

first_name = input()

generic_location = input()

whole_number = input()

plural_noun = input()

print(first_name, 'went to', generic_location, 'to buy', whole_number, 'different types of', plural_noun)

You might also like