-
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
Solution #574
base: master
Are you sure you want to change the base?
Solution #574
Conversation
app/main.py
Outdated
else: | ||
return 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.
else: is not needed
else: | |
return 0 | |
return 0 |
app/main.py
Outdated
super().__init__(name, is_hungry) | ||
self.is_hungry = is_hungry | ||
self.appetite = 3 |
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.
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
count = 0 | ||
for animal in animals: | ||
count += Animal.feed(animal) | ||
return count |
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 function
app/main.py
Outdated
def feed_animals(animals: list) -> int: | ||
count = 0 | ||
for animal in animals: | ||
count += Animal.feed(animal) |
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.
call method to instance
app/main.py
Outdated
print("The slippers delivered!") | ||
|
||
|
||
def feed_animals(animals: list) -> int: |
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.
list of what? Provide inner type
app/main.py
Outdated
print("The slippers delivered!") | ||
|
||
|
||
def feed_animals(animals: list[Animal | Cat | Dog]) -> int: |
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 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
No description provided.