From a6ab82a76e5a367aa933833c10391911168c2f2d Mon Sep 17 00:00:00 2001 From: Katherine-Greg Date: Wed, 11 Oct 2023 19:26:52 +0300 Subject: [PATCH] Solution --- app/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index d780768f..09c2bacb 100644 --- a/app/main.py +++ b/app/main.py @@ -12,8 +12,10 @@ def __init__(self, Animal.alive.append(self) def __repr__(self) -> str: - return "{{Name: {}, Health: {}, Hidden: {}}}".format( - self.name, self.health, self.hidden + return ( + f"{{Name: {self.name}," + f" Health: {self.health}," + f" Hidden: {self.hidden}}}" ) @@ -23,7 +25,8 @@ def hide(self) -> None: class Carnivore(Animal): - def bite(self, herbivore: Herbivore) -> None: + @staticmethod + def bite(herbivore: Herbivore) -> None: if isinstance(herbivore, Herbivore) and not herbivore.hidden: herbivore.health -= 50 if herbivore.health <= 0: