class Pet:
def __init__(self, name):
self.name = name
self.hunger = 50
self.happiness = 50
def feed(self):
print(f"You feed {self.name}.")
self.hunger -= 10
if self.hunger < 0:
self.hunger = 0
def play(self):
print(f"You play with {self.name}.")
self.happiness += 10
self.hunger += 5
if self.happiness > 100:
self.happiness = 100
def get_status(self):
print(f"\n{self.name}'s Status:")
print(f"Hunger: {self.hunger}/100")
print(f"Happiness: {self.happiness}/100\n")
pet_name = input("What would you like to name your pet? ")
my_pet = Pet(pet_name)
while True:
my_pet.get_status()
print("What would you like to do?")
print("1. Feed")
print("2. Play")
print("3. Quit")
choice = input("Enter your choice (1-3): ")
if choice == "1":
my_pet.feed()
elif choice == "2":
my_pet.play()
elif choice == "3":
print(f"Goodbye! {my_pet.name} will miss you!")
break
else:
print("Invalid choice. Please pick 1, 2, or 3.")
my_pet.hunger += 2
if my_pet.hunger > 100:
my_pet.hunger = 100