Skip to content

Commit

Permalink
Fixed instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
LassisterV16 committed Mar 11, 2025
1 parent 081a6fb commit 5a6003f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ def hide(self) -> None:


class Carnivore(Animal):
@classmethod
def bite(cls, prey: Herbivore) -> None:
def bite(self, prey: Herbivore) -> None:
if type(prey) is not Carnivore and not prey.hidden:
prey.health -= 50

if prey.health <= 0:
cls.alive.remove(prey)
self.alive.remove(prey)

0 comments on commit 5a6003f

Please sign in to comment.