diff --git a/app/main.py b/app/main.py index fa330947..e41c34ab 100644 --- a/app/main.py +++ b/app/main.py @@ -10,17 +10,14 @@ def __init__(self, name: str, self.health = health self.hidden = hidden - self.alive.append(self) + Animal.alive.append(self) - def __str__(self) -> str: + def __repr__(self) -> str: return (f"{{Name: {self.name}, " f"Health: {self.health}, " f"Hidden: {self.hidden}}}") - def __repr__(self) -> str: - return self.__str__() - class Herbivore(Animal): @@ -31,7 +28,7 @@ def hide(self) -> None: class Carnivore(Animal): @classmethod - def bite(cls, victim: "Herbivore") -> None: + def bite(cls, victim: Herbivore) -> None: if not isinstance(victim, Carnivore) and not victim.hidden: victim.health -= 50 if victim.health <= 0: