From 5a1bda97eae7ba68bf590de3237a176a5a7feaba Mon Sep 17 00:00:00 2001 From: Olena Lisova Date: Fri, 29 Sep 2023 11:37:51 -0400 Subject: [PATCH] Changes has been made --- app/main.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/main.py b/app/main.py index 3fb50b9a..551767b9 100644 --- a/app/main.py +++ b/app/main.py @@ -13,21 +13,19 @@ def __init__( Animal.alive.append(self) def __repr__(self) -> str: - return "{Name:" \ - + f" {self.name}, Health: {self.health}, Hidden: {self.hidden}"\ - + "}" + return ("{Name:" + + f" {self.name}, Health: {self.health}, Hidden: {self.hidden}" + + "}") class Herbivore(Animal): def hide(self) -> None: - if self.hidden: - self.hidden = False - else: - self.hidden = True + self.hidden = not self.hidden class Carnivore(Animal): - def bite(self, animal: Herbivore) -> None: + @staticmethod + def bite(animal: Herbivore) -> None: if (animal in Animal.alive and isinstance(animal, Herbivore) and not animal.hidden):