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
List the data types that are allowed for SQL attributes.
nalin [4]

Answer:

Explanation:

In the SQL database manipulation coding language, there are a variety of different available data types to use. These data types are the following.

  • Numeric
  • Date/Time
  • Character/String
  • Unicode Character/String
  • Binary
  • 3rd Party / Miscellaneous

Each of these data types has a wide range of subcategories (data types as well) that each handle different variables in a coding sequence. These subcategories can be all seen in the attached picture below.

6 0
3 years ago
The advantage of using a spreadsheet is:
Rama09 [41]

because it's a good thing

5 0
2 years ago
Sami needs to decide how the fonts, colors, and images will look on her new web site. Which will help her pian her design?
shtirl [24]
Maybe a sketchbook:))))
6 0
2 years ago
What are the three main sub-sectors in the IT-BPM industry?<br>IT class 9​
sergeinik [125]

Answer:

Business Process Managment.

Software Products.

Engineering Research and Development

8 0
3 years ago
Which font attribute would be most appropriate to make a papers heading stand out?
eimsori [14]

If you want your heading to pop out I would go for bold Becuase it shows the letters darker and bigger which would make the heading the center of attention.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Think about a time when someone made a biased judgment about you or acted unfairly toward you because of your age, skin color, c
    6·1 answer
  • In order to plan George's birthday, his father gave him a list of people who attended his birthday for the last five years. What
    5·1 answer
  • ________ of Willa Catha present an unadorned picture oflife on the prairies of the Midwestern United States during the19th centu
    8·1 answer
  • Explain in your own words how remote-access Trojans (RATs) work. How can these be used by attackers? How would a network adminis
    10·1 answer
  • 14. For the declaration, int a[4] = {1, 2, 3};, which one is right in the following description-
    12·1 answer
  • Generally speaking, what is a “best practice"?
    13·1 answer
  • Which two components are configured via software in order for a PC to participate in a network environment
    5·1 answer
  • What is Fill handle?
    12·1 answer
  • ¿por que hay peligros en internet?
    11·1 answer
  • _____ are fields that are used to personalize a mail merge document
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!