From 77c5134fb63e34ec7725f36f58d892f4a891a630 Mon Sep 17 00:00:00 2001 From: Severyn Krok Date: Mon, 9 Oct 2023 12:58:54 +0300 Subject: [PATCH] Implement py-herbivores-and-carnivores --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 796290ca..f2516311 100644 --- a/app/main.py +++ b/app/main.py @@ -31,7 +31,7 @@ def hide(self) -> None: class Carnivore(Animal): @staticmethod def bite(prey: Herbivore) -> None: - if not prey.hidden and isinstance(prey, Herbivore): + if isinstance(prey, Herbivore) and not prey.hidden: prey.health -= 50 if prey.health <= 0: prey.die()