From a106467dd4fcb8d0ed190deef97bbc6b3da1d774 Mon Sep 17 00:00:00 2001 From: Katherine-Greg Date: Sat, 14 Oct 2023 02:19:39 +0300 Subject: [PATCH] Solution --- app/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/main.py b/app/main.py index 09c2bacb..d3ede356 100644 --- a/app/main.py +++ b/app/main.py @@ -26,8 +26,8 @@ def hide(self) -> None: class Carnivore(Animal): @staticmethod - def bite(herbivore: Herbivore) -> None: - if isinstance(herbivore, Herbivore) and not herbivore.hidden: - herbivore.health -= 50 - if herbivore.health <= 0: - Animal.alive.remove(herbivore) + def bite(animal: Herbivore) -> None: + if not animal.hidden and isinstance(animal, Herbivore): + animal.health -= 50 + if animal.health <= 0: + Animal.alive.remove(animal)