Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Practice 2.2: Madlibs 15 pts Not Submitted Due Feb 2, 2020 at 11:59 PM Submission Types Website URL or File Upload File Types py

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Programming Practice 2.2: Madlibs 15 pts Not Submitted Due Feb 2, 2020 at 11:59 PM Submission Types Website URL or File Upload File Types py Submission & Rubric Description Lesson Objective(s): Get keyboard input Work with variables Lesson: Copy your initial program from Programming Practice 2.1 into a new .py file. Modify the file to accept input from the user, assign the input to a minimum of 8 variables, and use the variables in the output. You are essentially creating a mad- libs game. Helpful Hint: Remember, when you print both variables and strings using the + sign, you must add spaces before and after variables in the string. variable names in PyCharm should be separated by an underscore when there are two or more words: variable_name Assignment Requirements: Turn in your modified file that accepts input from the user, assigns the input to a minimum of 8 variables, and uses the variables in the output which essentially creates a mad-libs game. Sample Code: # Variables for MadLibs program person = input("Enter the name of a per pet = input("Enter a type of pet") color = input ("Enter a color: ") example = input ("Enter a noun:"). place = input ("Enter a place: ") group = input ("Enter a group of people: person2 = input ("Enter a person: ") adverb = input("Enter an adverb: ") action = input("Enter a verb") # Printing the mad libs result print (person + " had a little " + pet + print("His fleece was " + color + " as print("And everywhere that " + person + print("The " + pet + " was sure to go. print("He followed her to " + place + " print("Which was against the rule, ") print("It made the " + group + " laugh print("To see a " + pet + " at " + plac print("And so the " + person2 + " turne print("But still it lingered near,") print("And waited " + adverb + " about, print("Till " + person + " did appear. print("Why does the " + pet + " love" print("The eager " + group + " cry.") print("Why, " + person + " " + action + print("The " + person2 + " did reply.")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

Relational Contexts in Organizations

Answered: 1 week ago