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
The difference between the various networks is the ______ of the coverage.
ozzi
The answer to this is A. 
5 0
4 years ago
Read 2 more answers
In Python, what kind of error is returned by the following code? (e.g. NameError, ValueError, IOError, etc.) def my_func(n1, n2)
kodGreya [7K]

Answer:

SyntaxError.

Explanation:

https://www.quora.com/In-Python-what-kind-of-error-is-returned-by-the-following-code-e-g-NameError-ValueError-IOError-etc-def-my_func-n1-n2-return-n1-n2-my_func-1-2-3          sorce site

<h2></h2><h2></h2><h2></h2><h2>brainlest plz</h2>
6 0
4 years ago
TRUE OR FALSE: THE BUILDER'S CLUB IS A PAID SUBSCRIPTION.
nadya68 [22]

Answer:

true

Explanation:

3 0
3 years ago
Read 2 more answers
SYSTEMY INFORMATYCZNE: Archiwizacja i kompresja zbiorów systemu Linu
jeka94

Answer:

I'm not smart bxjbdndjdbdbd

5 0
3 years ago
Two VALS segments stand apart. One segment represents the group with the highest resources and innovation and the other segment
irina1246 [14]

Answer:

Innovators and Survivors

Explanation:

The innovators are always interested in new information, are open to new ideas and trying out new things, future oriented and excellent problem solving skills. They represent the group with the highest resources according to the VALS segments.

Survivors are the group with the lowest resources. They are risk adverse, and exhibit low motivation towards new ideas or experiences.

3 0
4 years ago
Other questions:
  • Colleen is creating a document with two minimal paragraphs of text comparing two business models for her company. She decides to
    14·2 answers
  • Where can information on metalworking occupations be found?
    14·2 answers
  • Which of the following is the most accurate description of what is known as the "digital divide". The digital divide is about ho
    5·2 answers
  • Li Chang has recently started his own business. He plans to launch his design for an application (app) for a smartphone. All of
    9·1 answer
  • Omar is preparing to deliver a presentation to his class. It is about a program to collect samples from an asteroid that has bee
    13·1 answer
  • Is it important for a writer to include voice and point of view in writing because...<br> Plz help
    10·1 answer
  • What best describes the computer's BIOS (basic input-output system)?
    5·1 answer
  • Working with do-while loop
    9·1 answer
  • Please tell fast plzzzzzzzzzzz.​
    9·1 answer
  • Which of formula contains an absolute cell reference?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!