asked 11.2k views
15 votes
Python question 4.2: Question 2

Python question 4.2: Question 2-example-1

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

answered
User Kaan Burak Sener
by
8.5k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.

Categories