1.9 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

Respuesta :

Answer:

I made one out your answers in comments i will put the story after. Put your description in comments. Pick only one word unless theres 2 cateories.

Explanation: Example : Names- john, Deon, Alex, Marcus

                                       Names- Lia, Stephanie, Mya, Jamacia

i chose Alex for this one.

Next.  Cars: Corvet, Audi,

Pick a noun. (Name)  girls- (lexi, Sophia, kenzie, maddison)

                    (Name)  boys- ( Logan,Joshua,caleb, preston)

pick an action  (jump, dance, walked)

Pick an adjective (color or texture.) pick from this Colors-  (blue, pink, red) Textures- (fluffy, hard, soft)

pick an adjective  (color or texture.) Textures- (Smooth, bumpy, worn out.)

Colors- Black, gray)

Pick a noun: Places: School, house, Mcdonalds, chipotle

Choose a number 1- 20

Choose a noun. Things: Robot, tv, phone, door knobs, flowers

The input() function could indeed insert a value in a program by one user. Returns the value of string input(). The components for input can be converted with just about any type of information. Users could indeed convert a user's value into a floating number for example.

Program Explanation:

  • In this code, four variables "name, location, number, and the noun" are declared that inputs value.
  • Inside these variables, "number" is used for input integer value and other is used for the input string value.
  • After input value, it uses the print method that prints the variable value with a message.

Program:

#defining variable that uses the input method to input value

name = input()#defining name variable to input value

location = input()#defining location variable to input value

number = int(input())#defining number variable to input integer value

noun = input()#defining noun variable to input value

print(name, 'went to', location, 'to buy', str(number), 'different types of', noun)# printing input value and print value with message

Output:

Please find the attached file.

Learn more:

brainly.com/question/14377991

Ver imagen codiepienagoya
ACCESS MORE
EDU ACCESS
Universidad de Mexico