-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
created animals classes #561
base: master
Are you sure you want to change the base?
Conversation
app/main.py
Outdated
points = self.appetite | ||
self.appetite = 0 |
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.
Not said that we need to change it to 0
app/main.py
Outdated
print(f"Hello, I'm {self.name}") | ||
|
||
def feed(self) -> int: | ||
if self.appetite and self.is_hungry: |
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 self.appetite and self.is_hungry: | |
if self.is_hungry: |
Not need to check by self.appetite
app/main.py
Outdated
def __init__(self, name: str, is_hungry: bool = True, | ||
appetite: int = 3) -> 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, is_hungry: bool = True, | |
appetite: int = 3) -> None: | |
def __init__( | |
self, name: str, appetite: int = 3, is_hungry: bool = True | |
) -> None: |
No need to change order of params
app/main.py
Outdated
def __init__(self, name: str, is_hungry: bool = True, | ||
appetite: int = 7) -> 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, is_hungry: bool = True, | |
appetite: int = 7) -> None: | |
def __init__( | |
self, name: str, appetite: int = 7, is_hungry: bool = True | |
) -> None: |
|
||
|
||
class Cat(Animal): | ||
def __init__(self, name: str, |
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.
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.
the same with Dog
No description provided.