Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
VolodymyrSemchysyn committed Oct 7, 2024
1 parent 04910ab commit fa11df4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def feed(self) -> int:
print(f"Eating {self.appetite} food points...")
self.is_hungry = False
return self.appetite
else:
return 0

return 0


class Cat(Animal):
def __init__(self, name: str, is_hungry: bool = True) -> None:
super().__init__(name, appetite=3, is_hungry=is_hungry)

@staticmethod
def catch_mouse() -> None:
def catch_mouse(self) -> None:
print("The hunt began!")
self.is_hungry = False


class Dog(Animal):
Expand All @@ -39,8 +39,4 @@ def bring_slippers() -> None:


def feed_animals(animals: list) -> int:
total_food = 0
for animal in animals:
if animal.is_hungry:
total_food += animal.feed()
return total_food
return sum([animal.feed() for animal in animals])

0 comments on commit fa11df4

Please sign in to comment.