From 90572c730023cd3bae69646c46cbd1032e4c6c9a Mon Sep 17 00:00:00 2001 From: taraskhom Date: Sun, 8 Dec 2024 19:04:44 +0200 Subject: [PATCH] Solution --- app/main.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/main.py b/app/main.py index 478506eb..223106ce 100644 --- a/app/main.py +++ b/app/main.py @@ -18,16 +18,12 @@ def __init__( if self.health > 0: Animal.alive.append(self) - def __str__(self) -> str: - return ( - f"Name: {self.name}, " - f"Health: {self.health}, " - f"Hidden: {self.hidden}" - ) - def __repr__(self) -> str: - - return f"{{{self}}}" + return str(( + f"{{Name: {self.name}, " + f"Health: {self.health}, " + f"Hidden: {self.hidden}}}" + )) class Herbivore(Animal):