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
Roman55 [17]
2 years ago
6

Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh

ould acknowledge the user in the following format. For the first pet, it should say You have a dog with a total of 1 pet(s) if they enter dog, and so on

Computers and Technology
1 answer:
mote1985 [20]2 years ago
6 0

Loops are program statements that are repeated as long as the loop condition is true.

The loop in Python, where comments are used to explain each line is as follows:

#This initializes the number of pets to 0

count = 0

#This gets input for the pet name

pet = input("Pet: ")

#This is repeated until the user enters "rock"

while pet.lower() != "rock":

   #This increases the number of pets by 1

   count+=1

   #This prints the pet and the number of pets

   print("You have a",pet,"with a total of",str(count),"pet(s)")

   #This gets input for the pet name

   pet = input("Pet: ")

Read more about loops at:

brainly.com/question/19344465

You might be interested in
What is the basic body structure of html.
hodyreva [135]

Answer:

A line holding HTML version information, a declarative header section (separated by the HEAD element), and a body containing the document's actual content make up an HTML 4 page.

8 0
2 years ago
Read 2 more answers
Question 2 of 10
NeTakaya

Answer:

D.

Because you said it was.

3 0
2 years ago
Tina has taken the time to modify font sizes and colors in a text box and would like to duplicate those settings on other text b
Ivan

Answer:

a, duplicate the object.

Explanation:

just took the exam on edg

5 0
3 years ago
Read 2 more answers
What kind of device is a printer? output or input
ANEK [815]
A printer is output. :)
8 0
3 years ago
Two strategies for keeping your files in sync
zlopas [31]

Answer:

1. MS Cloud

2. G Drive

Explanation:

5 0
3 years ago
Other questions:
  • Describe in one or more complete sentences how someone starting a computer repair business in a town night gain a competitive ad
    15·1 answer
  • the part of the computer that contains the brain , or central processing unit , is also known the what ?
    12·1 answer
  • The "origin" of the cartesian plane in math is the point where x and y are both zero. Given a variable, origin of type Point-- a
    5·1 answer
  • Eye wash stations should contain enough water to provide ______ minutes of continuous use
    5·2 answers
  • What is a directed graph?
    5·1 answer
  • 12) If the image's name is filename.gif, how can I make this image the background of my page?
    6·1 answer
  • Need help please. this effect my technology
    15·1 answer
  • What are some example of popular music for teenagers
    8·2 answers
  • Direction: Read each item carefully and choose the letter of the correct answer. Write your answers on a separate sheet of paper
    12·1 answer
  • Binary subtraction<br> Subtract (111) from (1000)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!