11.2k views
15 votes
Python question 4.2: Question 2

Python question 4.2: Question 2-example-1
User Guruprasad
by
3.5k points

1 Answer

4 votes

Answer:

n=1

while True:

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

if i=="rock":

break

else:

print("You have a " + i + " with a total of " + str(n) + " pet(s)")

n=n+1

User Kaan Burak Sener
by
3.9k points