Skip to content

Commit

Permalink
Solution fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiskoRuslan committed Oct 10, 2023
1 parent 72a6240 commit ed32feb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ def hide(self) -> None:


class Carnivore(Animal):
def bite(self, herbivore: Herbivore) -> None:
if isinstance(herbivore, Herbivore) is False:
return
if herbivore.hidden is True or herbivore.health < 1:
return
herbivore.health -= 50
self.check_alive_animals()
@staticmethod
def bite(herbivore: Herbivore) -> None:
if isinstance(herbivore, Herbivore) and herbivore.hidden is False:
herbivore.health -= 50
Animal.check_alive_animals()

0 comments on commit ed32feb

Please sign in to comment.