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
frosja888 [35]
3 years ago
12

Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I

t should 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.
Sample Run:
User enters:
lemur parrot cat rock
Outputs:
You have a lemur with a total of 1 pet(s)
You have a parrot with a total of 2 pet(s)
You have a cat with a total of 3 pet(s)
Computers and Technology
1 answer:
DedPeter [7]3 years ago
7 0

Answer:

Check the explanation

Explanation:

The Python program that frequently asks the user what pets the user has,

until the user enters "rock", in which case the loop ends can be analysed in the written codes below.

'''

# count of pets

count = 0

# read the user input

pet = input()

# loop that continues till the user enters rock

# strip is used to remove the whitespace

while pet.strip() != 'rock':

  # increment the count of pets

  count += 1

  # output the pet name and number of pets read till now

  print('You have a %s with a total of %d pet(s)' %(pet.strip(),count))

  pet = input() # input the next pet

#end of program

You might be interested in
A section-lined area is always completely bounded or outlined by an?
Paraphin [41]
Visible outline.
hope this helps
8 0
3 years ago
Answers please !!!!!!!!!!!!!!!!!!!!!!!!!!!
alina1380 [7]
Hard to see please add a better image. Actually just type out the question.
4 0
4 years ago
Select the correct answer.
ss7ja [257]
The answer a identifying portfolio goal
8 0
3 years ago
Read 2 more answers
What some one ask me if i am more of hardware or software person, what is that mean?
balu736 [363]

Answer: Any person or people asking about someone being a hardware or software person displays that they are questioning about the computer knowledge of the person and his/her interest.

The interest can be regarding software tools for programming, designing ,  etc or hardware device like troubleshooting, assembling the computer parts ,etc.

The person persisting good knowledge about software programming language and software is diverted towards software side .The person who likes to deal with hardware parts of the computer system is hardware-oriented person.

7 0
3 years ago
What property do we use to distinguish a specific element from a form? value name click this
Andrews [41]
<span>If you match the physical properties of a substance you dont know about to the properties of a known substance, you now know what you've got. For example, if you know that compound X is bright yellow and screams when you poke it, an unknown sample that is yellow and screams that you poke it is probably compound X. trust me, im a dog in a suit.</span>
7 0
3 years ago
Other questions:
  • What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
    5·2 answers
  • What are some of the advantages of using the F measure (weighted harmonic mean) over using the Precision &amp; Recall when evalu
    15·1 answer
  • It's better to create tables just by starting typing in the data that you want the table to store. There is no need to name fiel
    6·1 answer
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • What devices gives input​
    5·1 answer
  • ____ returns the maximum number of elements that can be inserted into the vector container vecCont without reallocation.
    9·1 answer
  • Maria is creating a program where the user will enter their name to begin. What kind of variable should be used for the user’s n
    15·2 answers
  • Draw a flow chart to access the marks of three students. calculate the total avarage and display the result​
    11·1 answer
  • All Office programs have similar commands on the tab for changing the document view a. File b. View c. Locate d. display ​
    5·1 answer
  • Why should we learn Ethereum? Explain.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!