class Fruit: def __init__(self, name, color): self.name = name self.color = color self.eaten = False self.age = 0 def is_eaten(self): return self.eaten def eat(self): self.eaten = True def allergy_check(self, allergic_color): return self.color == allergic_color def age_fruit(self): self.age += 1 def __str__(self): return self.color + " " + self.name + " that is " + \ str(self.age) + " days old" fruit = Fruit("banana", "yellow") print(fruit) print(fruit.allergy_check("red")) fruit.age_fruit() print(fruit) print(fruit.is_eaten()) fruit.eat() print(fruit.is_eaten())