Skip to content

Commit

Permalink
fixed solution
Browse files Browse the repository at this point in the history
  • Loading branch information
kostomeister committed Oct 10, 2023
1 parent 293ef87 commit 9413aa9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Animal:

alive = []

def __init__(
Expand Down Expand Up @@ -32,9 +31,9 @@ def hide(self) -> None:
class Carnivore(Animal):

def bite(self, herbivore: Animal) -> None:
if isinstance(herbivore, Herbivore):
if not herbivore.hidden:
herbivore.health -= 50
if isinstance(herbivore, Herbivore) and not herbivore.hidden:
if herbivore.health <= 0:
herbivore.die_animal()
herbivore.health -= 50


if herbivore.health <= 0:
herbivore.die_animal()

0 comments on commit 9413aa9

Please sign in to comment.