lst = []
for i in range(10000000):
n = input("What pet do you have? ")
if n == "rock":
break
else:
lst.append(n)
for i in range(len(lst)):
print("You have a",lst[i], "with a total of ",i+1,"pet(s)")
This code is valid for range greater than 3. Range can be changed according to the limit of the inputs.
Comments
Leave a comment