Skip to content

Commit

Permalink
Adding static status for the 'bite' method in Carnivore class
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorov-s-od committed Oct 10, 2023
1 parent f9919d3 commit f2e4cdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def hide(self) -> None:


class Carnivore(Animal):
def bite(self, herbivore: Herbivore) -> None:
@staticmethod
def bite(herbivore: Herbivore) -> None:
if isinstance(herbivore, Herbivore) and herbivore.hidden is not True:
herbivore.health -= 50

Expand Down

0 comments on commit f2e4cdc

Please sign in to comment.