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
. _______ view focuses on the text and content of a document, without much information on the page layout.
Georgia [21]
Read view
It allows to hide all instrument panels
5 0
3 years ago
Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
KatRina [158]
The recommendation of the instructor for Gaven to include a personal statement in his work portfolio will allow him to identify his career goals. If he is unable to show this to his work portfolio then he may simply state it in the personal statement. Thus, the answer to this item is letter A. 
6 0
3 years ago
Why was unicode invented?
Julli [10]
Unicode was invented to create a "universal text", or a language framework that any computer or device could understand. 


5 0
3 years ago
Anyone know why my pc won’t start up I upgraded my ram and everything seems fine
ser-zykov [4K]

Answer:

RAM Slots

Explanation:

If you upgraded RAM then check if RAM is in correct slots according to the Motherboard Manual, i had the same issue when i replaced my RAM.

4 0
2 years ago
Television, the internet, and smartphones are different communication _______blank hsn uses in its imc.
Sati [7]

Answer:

serivices

Explanation:

7 0
1 year ago
Other questions:
  • In two to three paragraphs, come up with a way that you could incorporate the most technologically advanced gaming into your onl
    10·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • When did gaming become a thing?
    7·2 answers
  • Samira works for a large U.S. company that has factories all over the world. Samira returned to the U.S. after visiting several
    9·1 answer
  • Implement function bin2dec that takes a binary number bin_num as a string argument and prints out the corresponding decimal numb
    9·1 answer
  • To change lowercase letters to uppercase letters in a smaller font size, which of the following should be done?
    10·1 answer
  • Write a function template that accepts an argument and returns its absolute value. The absolute value of a number is its value w
    11·1 answer
  • Universal containers set the organization-wide defaults for cases to private. When a case is escalated, case ownership changes t
    13·1 answer
  • The process of redefining the functionality of a built-in operator, such as , -, and *, to operate on programmer-defined objects
    14·1 answer
  • I need the answer asap !!!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!