Skip to content

Commit

Permalink
Implement py-herbivores-and-carnivores
Browse files Browse the repository at this point in the history
  • Loading branch information
SevKrok committed Oct 9, 2023
1 parent 6f0b9a1 commit 77c5134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 77c5134

Please sign in to comment.