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 #1427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #1427

wants to merge 1 commit into from

Conversation

kolya2731
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.

Great job on implementing the Animal class and its subclasses! 🎉 Your code meets the task requirements, and the class structure and inheritance are well done. The only minor issue is with the removal of animals from the alive list. Remember to use Animal.alive.remove(animal) to ensure you're modifying the correct list. Keep up the good work, and happy coding! 😊

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

Comment on lines +30 to +31
if animal.health <= 0:
self.alive.remove(animal)

Choose a reason for hiding this comment

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

There is an issue with the removal of the animal from the alive list. The alive list is a class attribute of Animal, so you should access it using Animal.alive.remove(animal) instead of self.alive.remove(animal). This ensures that the animal is removed from the correct list.

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.

2 participants