-
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
task completed #628
base: master
Are you sure you want to change the base?
task completed #628
Conversation
app/main.py
Outdated
total_food_points = 0 | ||
for animal in animals: | ||
total_food_points += animal.feed() | ||
return total_food_points |
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 sum and comprehension here
app/main.py
Outdated
print(f"Eating {self.appetite} food points...") | ||
self.is_hungry = False | ||
return self.appetite | ||
else: |
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.
remove redundant else
app/main.py
Outdated
def __init__(self, name: str, is_hungry: bool = True) -> None: | ||
super().__init__(name, appetite=3, is_hungry=is_hungry) | ||
|
||
def catch_mouse(self) -> 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.
Also you can make this method static
app/main.py
Outdated
def __init__(self, name: str, is_hungry: bool = True) -> None: | ||
super().__init__(name, appetite=7, is_hungry=is_hungry) | ||
|
||
def bring_slippers(self) -> 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.
Also you can make this method static
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.
Well done!
No description provided.