140k views
5 votes
Python plese help 4.2 projectstem

it keeps saying error


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

c=1

while(pet!="rock"):

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

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

c = c + 1

Python plese help 4.2 projectstem it keeps saying error pet=input("What pet do-example-1
Python plese help 4.2 projectstem it keeps saying error pet=input("What pet do-example-1
Python plese help 4.2 projectstem it keeps saying error pet=input("What pet do-example-2

1 Answer

5 votes

Answer: while(pet!="stop"):

Step-by-step explanation:

here was my code for that lesson

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

total = 0

while pet!="stop":

total+=1

print("You have one " + pet + ". Total # of Pets: " + str(total))

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

User Cleb
by
8.8k points