From 6f8b53ad34454aae57d261056d6d08db5108a057 Mon Sep 17 00:00:00 2001 From: Denis Komandyr Date: Tue, 10 Oct 2023 00:57:32 +0300 Subject: [PATCH] bite conditions simplified --- app/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 6d82efd5..b9951a72 100644 --- a/app/main.py +++ b/app/main.py @@ -28,8 +28,6 @@ class Carnivore(Animal): @staticmethod def bite(target: Herbivore) -> None: if not isinstance(target, Carnivore) and not target.hidden: - if target.health > 50: - target.health -= 50 - elif target.health <= 50: - target.health = 0 + target.health -= 50 + if target.health <= 0: Animal.alive.pop(Animal.alive.index(target))