-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"solution" #665
base: master
Are you sure you want to change the base?
"solution" #665
Conversation
app/main.py
Outdated
Animal.alive.append(self) | ||
|
||
def __repr__(self) -> str: | ||
return f"{{Name: {self.name}, Health: " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use () instead of \
app/main.py
Outdated
class Carnivore(Animal): | ||
@staticmethod | ||
def bite(herbivore: Herbivore) -> None: | ||
if not isinstance(herbivore, Carnivore) and not herbivore.hidden: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not isinstance(herbivore, Carnivore) and not herbivore.hidden: | |
if isinstance(herbivore, Herbivore) and not herbivore.hidden: |
app/main.py
Outdated
def __init__(self, name: str, | ||
health: int = 100, hidden: bool = False) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __init__(self, name: str, | |
health: int = 100, hidden: bool = False) -> None: | |
def __init__( | |
self, name: str, | |
health: int = 100, | |
hidden: bool = False | |
) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
app/main.py
Outdated
def __init__(self, name: str, | ||
health: int = 100, hidden: bool = False) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do it
No description provided.