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

Feeding #1316

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

Feeding #1316

wants to merge 2 commits into from

Conversation

AlyaVKravchenko
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this Pull Request! 😊 However, there are a few critical issues that need to be addressed to ensure the code functions correctly:

  1. Constructor Initialization: The Cat and Dog classes are missing the appetite argument in their super().__init__ calls. The Cat class should pass an appetite of 3, and the Dog class should pass an appetite of 7. This is essential for the proper functioning of the Animal class constructor.

  2. Return Value in print_name Method: The print_name method should return a string instead of printing it. This change is necessary to meet the expected functionality.

Please make these changes to align with the core requirements of the task. Once updated, your code will be in great shape! Keep up the good work, and don't hesitate to reach out if you have any questions. 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

app/main.py Show resolved Hide resolved
app/main.py Outdated


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

Choose a reason for hiding this comment

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

The super().__init__ call is missing the appetite argument required by the Animal class constructor. You should pass the default appetite value for a Cat (3) to the super().__init__ call.

app/main.py Outdated


class Dog(Animal):
def __init__(self, name: str, is_hungry: bool = True) -> None:

Choose a reason for hiding this comment

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

The super().__init__ call is missing the appetite argument required by the Animal class constructor. You should pass the default appetite value for a Dog (7) to the super().__init__ call.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on addressing the previous issues in your code! 🎉 Here are a few points to consider for further improvement:

  1. Incorrect Argument in Cat Initialization: Ensure that the Cat instance is initialized with an integer for appetite instead of a boolean. This is crucial for the code to function correctly.

  2. Redundant Attribute Initialization: In both Cat and Dog classes, the appetite and is_hungry attributes are being set twice. Since they are already initialized in the super().__init__ call, you can remove the redundant initialization.

Overall, your code is in good shape and meets the task requirements. Keep up the good work and make sure to address these points in future iterations to enhance your coding skills. Remember, learning from these experiences will help you grow as a developer. 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

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

Choose a reason for hiding this comment

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

The appetite and is_hungry attributes are already initialized in the super().__init__ call. You don't need to set them again in the Cat class constructor.

def __init__(self, name: str, appetite: int = 7, is_hungry: bool = True) -> None:
super().__init__(name, appetite, is_hungry)
self.appetite = appetite
self.is_hungry = is_hungry

Choose a reason for hiding this comment

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

The appetite and is_hungry attributes are already initialized in the super().__init__ call. You don't need to set them again in the Dog class constructor.

feed_num.append(animal.feed())
return sum(feed_num)

cat = Cat("Cat", False)

Choose a reason for hiding this comment

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

The Cat instance is being initialized with a boolean value False instead of an integer for appetite. This should be an integer value, such as 3.

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