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
By using the search functionality within a twitter stream, users can filter for:
rosijanka [135]
By using the search functionality within a twitter stream, users can filter for: Tweets containing keywords and key phrases, Tweets from specific users, Tweets containing @mentions, Tweets from specific locations.  <span>The secret to using Twitter effectively is using the Twitter lists. </span>Each Twitter list you create, gives you a different Twitter stream, customized to your liking. It will only include tweets sent out by those accounts you have added to the list
6 0
3 years ago
Which types of operating systems execute program independent of the users and generate output within a specific amount of time?
soldi70 [24.7K]
Real-Time Operating System –
These types of OSs serves the real-time systems. The time interval required to process and respond to inputs is very small. This time interval is called response time.

Real-time systems are used when there are time requirements are very strict like missile systems, air traffic control systems, robots etc.

https://www.geeksforgeeks.org/operating-system-types-operating-systems-awaiting-author/
3 0
3 years ago
If I wanted to repeat an action such as a heading for a paper, it would be helpful to _____. create a citation create a caption
salantis [7]
Um... Copy and paste
7 0
3 years ago
Read 2 more answers
4. What is an example of a Trans receiver? *<br> A. Pager<br> B. Wi-Fi<br> C. Telephone
Charra [1.4K]
I really think it A : pager
I hope this helps !!
8 0
3 years ago
Which of the following is NOT a common grammar adjustment which is identified by grammar-check software?
Sedbober [7]

Answer:

Shortened versions of phrases Ex:(l ol, s mh, i dk, ect.)

Explanation:

Hope that this helps, if you have any more question please feel free to contact me, hope you have an amazing rest of your day. ;D

7 0
3 years ago
Other questions:
  • Ajay wants to read a brief overview about early settlers in the United States. Which type of online text source should he most l
    9·2 answers
  • Apart from confidential information, what other information does NDA help to outline?
    15·1 answer
  • After clicking the Start button on your computer screen desktop, what option would you then select to examine system components
    5·1 answer
  • Even though a high-level programming language
    11·1 answer
  • Hydraulic systems use liquids because _____.
    14·2 answers
  • What are 3 ways to select an entire document?
    15·1 answer
  • If Anyone can help me out that'll be great
    11·1 answer
  • What are 3 similarities and 3 differences between live theatre and film/videos -Drama Class
    13·1 answer
  • MULTIPLE COICE! BRAINLIEST
    12·1 answer
  • You were recently hired by a small start-up company. The company is in a small office and has several remote employees. You have
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!