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

Solution #574

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

Solution #574

wants to merge 3 commits into from

Conversation

OlPlaksa
Copy link

No description provided.

app/main.py Outdated
Comment on lines 20 to 21
else:
return 0

Choose a reason for hiding this comment

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

else: is not needed

Suggested change
else:
return 0
return 0

app/main.py Outdated
Comment on lines 26 to 28
super().__init__(name, is_hungry)
self.is_hungry = is_hungry
self.appetite = 3

Choose a reason for hiding this comment

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

Suggested change
super().__init__(name, is_hungry)
self.is_hungry = is_hungry
self.appetite = 3
super().__init__(name, 3, is_hungry)

Just pass the parameters here. Fix inside dog

app/main.py Outdated
Comment on lines 47 to 50
count = 0
for animal in animals:
count += Animal.feed(animal)
return count

Choose a reason for hiding this comment

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

Use sum function

app/main.py Outdated
def feed_animals(animals: list) -> int:
count = 0
for animal in animals:
count += Animal.feed(animal)

Choose a reason for hiding this comment

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

call method to instance

app/main.py Outdated
print("The slippers delivered!")


def feed_animals(animals: list) -> int:

Choose a reason for hiding this comment

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

list of what? Provide inner type

app/main.py Outdated
print("The slippers delivered!")


def feed_animals(animals: list[Animal | Cat | Dog]) -> int:

Choose a reason for hiding this comment

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

Suggested change
def feed_animals(animals: list[Animal | Cat | Dog]) -> int:
def feed_animals(animals: list[Animal]) -> int:

Cat and Dog is inherit from Animal that means all will be work okay

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