Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
taraskhom committed Dec 8, 2024
1 parent 2c42b4d commit 90572c7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ def __init__(
if self.health > 0:
Animal.alive.append(self)

def __str__(self) -> str:
return (
f"Name: {self.name}, "
f"Health: {self.health}, "
f"Hidden: {self.hidden}"
)

def __repr__(self) -> str:

return f"{{{self}}}"
return str((
f"{{Name: {self.name}, "
f"Health: {self.health}, "
f"Hidden: {self.hidden}}}"
))


class Herbivore(Animal):
Expand Down

0 comments on commit 90572c7

Please sign in to comment.