From e5596971502d42a5a7c0380037d8a3b6980081c3 Mon Sep 17 00:00:00 2001 From: Denys Date: Wed, 11 Oct 2023 11:49:50 +0200 Subject: [PATCH] fix code --- app/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 1fe1d8bf..5b684484 100644 --- a/app/main.py +++ b/app/main.py @@ -1,9 +1,11 @@ class Animal: alive = [] - def __init__(self, name: str, + def __init__(self, + name: str, health: int = 100, - hidden: bool = False) -> None: + hidden: bool = False + ) -> None: self.name = name self.health = health self.hidden = hidden @@ -25,7 +27,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: