Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

DaniilHinzburh
Copy link

No description provided.

app/main.py Outdated
Comment on lines 39 to 42
total_food_points = 0
for animal in animals:
total_food_points += animal.feed()
return total_food_points
Copy link
Contributor

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:
Copy link
Contributor

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 Show resolved Hide resolved
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:

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:

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

Copy link

@ArsenPidhoretskyi ArsenPidhoretskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants