Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Kateryna-Bordonos17 committed Oct 13, 2023
1 parent a6ab82a commit a106467
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a106467

Please sign in to comment.