1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ray Of Light [21]
3 years ago
12

4.15 LAB: Mad Lib - loops Mad Libs are activities that have a person provide various words, which are then used to complete a sh

ort story in unexpected (and hopefully funny) ways. Write a program that takes a string and integer as input, and outputs a sentence using those items as below. You may assume that the string does not contain spaces.The program repeats until the input is quit 0. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. Note: This is a lab from a previous chapter that now requires the use of a loop. LAB ACTIVITY 4.15.1: LAB: Mad Lib - loops 0 / 10
Computers and Technology
1 answer:
Sergio039 [100]3 years ago
7 0

Answer:

Following are the program in the Python Programming Language.

#set the infinite while loop

while(True):

 #get string input from the user

 name=input()

 #get integer input from the user

 num=int(input())

 #set the if statement to break the loop

 if(num==0):

   break

 #otherwise, print the following output

 else:

   print("Eating {} {} a day keeps the doctor away.".format(num, name))

<u>Output</u>:

oranges

5

Eating 5 oranges a day keeps the doctor away.

apple

0

Explanation:

<u>Following are the description of the program</u>:

  • Set the loop that iterates at infinite times and inside the loop.
  • Declare two variables which are 'name' that get string type input from the user and 'num' that get integer type input from the user.
  • Set the if conditional statement for break the infinite while loop.
  • Otherwise, it prints the following output.
You might be interested in
The bindery process of cutting irregular shapes and patterns in press sheets is called what?
konstantin123 [22]
B. Die cutting. Typically a metal die with various shapes and patterns is rolled over paper, cardboard, etc to punch out.
3 0
4 years ago
By what decade were books readily available to the public across the United States and Europe?
Westkost [7]

Answer:

1690's hope i could help!

5 0
3 years ago
Bill is pushing a box with 10 N of force to the left, while Alice is pushing the box with 30 N of force to the right. What is th
Greeley [361]

Answer:

Net force = 20 N

Explanation:

Given that,

Force acting on the left = 10 N

Force acting on the right = 30 N

Let right side is positive and left side is negative. Let the net force acting on the box is F. So,

F = -10+30

F = 20 N

So, the net force on the box is 20 N and it is in right side.

7 0
3 years ago
What do you think has happened to the Earth? Provide evidence from the movie. *
Jet001 [13]

Answer:

We dont have the movie-

Explanation:

Maybe just look at ur notes

8 0
3 years ago
One of the following is NOT a basic linked list operation:_________.
Llana [10]

Answer:

One of the following is NOT a basic linked list operation:_________.

g) build list from file

Explanation:

Linked list operation is the creation of trees and graphs or a chain of data elements, which are called nodes.  Each note points to the next using a pointer.  In linked lists, each node consists of its own data and the address of the next node.  A linked list, which may be single, double, or circular, forms a chain-like structure that builds from one node to the other.

4 0
3 years ago
Other questions:
  • An example of software is
    9·2 answers
  • Write a program that asks for a password and then verifies that it meets the stated criteria. • If the password meets the criter
    13·1 answer
  • Patti would like more information about product recalls. Which of the following resources would not be reliable and relevant? ww
    12·2 answers
  • if you want to present slide to fellow student or co-workers, wich productivity software should you use to create them?
    7·1 answer
  • One of the most toxic components of a computer is the
    11·1 answer
  • A key benefit of inheritance is Group of answer choices an object can have several types, it is type compatible with any of its
    11·1 answer
  • Lin is booting up his computer, and during the boot process, the computer powers down. After several unsuccessful attempts to bo
    12·1 answer
  • Yazmin is reading a book that has 74 pages. She has read 38 pages. How many more pages does she need to read to finish the book​
    6·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
  • What controls can be found on the File tab of Microsoft PowerPoint? Check all that apply. Help Print Track Open Insert Save
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!