4.2 Code Practice: Question 2Instructions
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 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
What pet do you have? lemur
What pet do you have? parrot
What pet do you have? cat
What pet do you have? rock
------------
Sample Output
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)

Answers

Answer 1
Answer:

In python 3:

total = 0

while True:

   pet = input("What pet do you have? ")

   if pet == "rock":

       break

   total += 1

   print("You have a {} with a total of {} pet(s)".format(pet, total))

I hope this helps!

Answer 2
Answer:

Answer:

pet = input(str("What pet do you have?"))

totalPets = 1

while(pet!="rock"):

  print("You have a " + str(pet) + " with a total of " + str(int(totalPets)) + " pet(s)")

  totalPets = totalPets+ 1

  pet = input(str("What pet do you have?"))


Related Questions

Well-produced video clips add value when they help explain a procedure or show movement that cannot be captured in a photograph.
If you're unsure of what chart to use for a set of data, what feature does Excel include that will help you to decide?
True or False: A recent source of toxic waste is the disposal of computer components.
Which technique will you use to make listening to audio a pleasant experience?Audio _____ is the smooth shift of one audio file into another.
a) To calculate the Amount for Keyboard: SUM(D2:D6) b) To calculate the Amount for Mouse: SUM(D7:D11) c) To calculate the Amount for USB drive: SUM(D12:D16) d) To calculate Maximum Price: MAX(D2:D16) e) To calculate Average Price: AVERAGE(D2:D16)

Find and enter the correct amount. 5 9 of a $18 restaurant bill = $

Answers

Answer:

Calculate a tip or gratuity and get the total amount to pay. Enter your meal or dinner cost along with the tip percentage.  If you are splitting the cost at a restaurant among several people you can divide by the number of people to get the total cost each.  Optionally round the results to dollars.

BRAINLIEST PLEASE

Tip = Cost * 0.xx

Total including Tip = Cost * 1.xx Explanation:

Can someone please check my answers?1) The magnification of a lens is also known as which of the following?

A)Digital zoom
B)Focal length
C)Aperture
D)Shutter speed

2) Which type of lenses shrinks the image in front of it rather than magnifying it?

A)Telephoto
B)Optical zoom
C)Digital zoom
D)Wide-angle


3) Film is sensitive to which of the following?

A)Noise
B)Vibration
C)Light
D)Movement

4) What opens between the lens and the film in order to create the photograph?

A)A shutter
B)A pentaprism
C)A pixel
D)An aperture

5) Aperture is controlled by what in the camera?

A)Pentaprism
B)Lens
C)White balance
D)Iris diaphragm

6) What is the equivalent of film speed in digital cameras?

A) Aperture
B) Sensitivity
C) White balance
D) Light metering

7) Which popular file format loses some of the information from the image?

A)JPEG
B)TIFF
C)RAW
D)NEF

8) How do point and shoot cameras differ from SLR cameras?

A)They are take smaller sized photographs

B)What is seen in the viewfinder is not an exact replica of the image that will be taken in point and shoot cameras

C)Point and shoot cameras use film

D)Only SLR cameras can take black and white photographs

9) What type of zoom crops the image and enlarges this cropped image to fill the frame of the camera?

A)Telephoto zoom
B)Optical zoom
C)Digital zoom
D)Wide angle zoom

10) What are pixels?

A)The colors in an image
B)The overall size of the images
C)The overall file size of the image
D)The smallest unit on the image that can be controlled.

11) A photograph is taken by letting light fall on a light-sensitive medium, which then records the image onto that medium.

A)True
B)False

12) Aperture is the length of time that light is let into the camera in order to expose the film.

A)True
B)False

13) TIFF is the default file format for most digital cameras.

A)True

B)False

14) A camera in manual mode means that the camera will make all of the adjustments for the photographer.

A)True
B)False

15) Rather than having a mirror within the camera that reflects the image, point and shoot cameras have viewfinder that goes directly through the camera, giving the photographer a slightly different angle on the scene that what the shutter will open to capture.

A)True
B)False

My Answers: 1)b, 2)d, 3)c, 4)a, 5)d, 6)b, 7)a, 8)b, 9)c, 10)d, 11)a, 12)b, 13)a, 14)b, 15)a

Answers

Answer:

1 is A)Digital zoom

2 is D) Wide Angle

3 is C) Light

4 is A) Shutter

5 is D) Iris Diaphragm

6 is B) Sensitivity

7 is A) JPEG

8 is B)  What is seen in the Veiw Finder is ot and exact replica

9 is C) Digital Zoom

10 is D) The smallest unit on the image that can be controlled

11 is A) true

12 is A) True

13 is A true

14 is B) False

15 is A) True

Explanation:

1. magnification is the ratio of image distance to object distance

2. wide angle

3. Film is sensitive to light. Optics is all about the study of light. The camera is a replica of the human eye

4.Shutter opens between lens and film

5.iris diaphragm

6. sensitivity is the equivalent of film speed

7. JPEG

8.b

9.Digital zoom crops the image

10. The smallest unit on the image that can be controlled. are called pixels

11. a

12.b

13. a

14b

15. a

Complete the code.A sample member of the list data is a1 = ['male',True], which indicates a male was on the phone.

for item in data:
if item[ ____ ] == 'male':

males = males + 1
if item[1]:

• 1
• 0
• 2

Answers

The complete code is for an item in data: if item[ 0 ] == 'male': The correct option is B.

What is coding?

We connect with computers through coding, often known as computer programming. Coding is similar to writing a set of instructions because it instructs a machine on what to do.

You can instruct computers what to do or how to behave much more quickly by learning to write code. Languages written in an imperative, functional, logical, or object-oriented style are common.

These coding language paradigms are available for programmers to select from in order to best meet their demands for a given project. You don't need advanced math abilities for the majority of coding careers, while some programming fields (like game development and machine learning) do demand it.

Therefore, the correct option is B, 0.

To learn more about coding, refer to the link:

brainly.com/question/17204194

#SPJ2

Answer:

0

Explanation:

In the lists, indexation starts from 0, because of that in if statement we compare item[0] which is 'male' and 'male', and then males is itterated within for loop.

Digital editing is accessible to anyone nowadays, however, it is still very expensive to record and edit audio.a. True
b. False

Answers

Completely False, you can do it for free. However professional recording studios is a different story, but that is not what this question is about.

I'm on Alpha omega academy and the correct answer would be false.

Administrators who are wary of using the same tools that attackers use should remember that a tool that can help close an open or poorly configured firewall will not help the network defender minimize the risk from attack. True or false?

Answers

Answer:

False.

Explanation:

Administrators showing caution in using the same tools that are used by the attackers remember that tool that can help to close a poorly configured or open firewall will help network defender and it will minimize the risk from the attack.

Hence the answer to this question is false.

Given the data in the chart, which two countries enjoy an absolute advantage in oil production over the United States?4

Answers

Answer:

Russia and Saudi Arabia

Explanation:

If you look at the oil production time, Russia and Saudi Arabia are the only two countries who have absolute advantage for oil production because it takes them less hours than the US to produce oil.

Where’s the data cahrt..........