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
Which of these words is used to begin a conditional statement?<br> when<br> input<br> if<br> until
LiRa [457]

Answer:

'if'

Explanation:

The if word is used in an if-statement (a type of conditional statement) that allows the computer to do certain computations based on what the conditional statement evaluates to.

Hope this helps :)

5 0
2 years ago
A serial schedule:
Lina20 [59]

Answer:

B)

Explanation:

Is alwayd sorted sequentially in aceding order by transaction ID

6 0
2 years ago
The hottest part of the Earth is the
Troyanec [42]
C. Mantle would be correct
3 0
3 years ago
Read 2 more answers
The file format is used for graphic files.
Vesna [10]

Answer:

.GIF

Explanation:

GIF or Graphics Interchange Format files are widely used for web graphics, because they are limited to only 256 colors, can allow for transparency, and can be animated. GIF files are typically small is size and are very portable.

8 0
2 years ago
How long will it take to transfer 1GB data on USB 2.0, on USB 3.0
cupoosta [38]

Answer:

Have a great day, Here is the answer to your question:

It will take around 18 seconds

Explanation:

So in principle 1GB of data to be uploaded running at peak speed is suggested to take around 18 seconds but in fact, DCD test results show USB 2.0 takes 3 minutes 18 seconds to complete a 1GB switch. Whereas USB 3.0 can accommodate up to 5gbps of data transferred-more than 10 times faster than its predecessor.

8 0
3 years ago
Other questions:
  • 1) why is software engineering considered engineering and not manufacturing?
    9·1 answer
  • In what country did true printing first take place?
    12·2 answers
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • Which of the following is the correct ordering of operating systems, oldest to newest?
    5·2 answers
  • The Python print function
    9·1 answer
  • Java supports ________; collections of related methods that typically enable you to tell objects what to do, but not how to do i
    12·1 answer
  • Who here has a crush on jk from bts but feels more mature than him
    10·2 answers
  • Which command tells the for loop what to count by?
    9·2 answers
  • Draw a flow chart to access the marks of three students. calculate the total avarage and display the result​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!