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

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

Solution #715

wants to merge 3 commits into from

Conversation

roffi37
Copy link

@roffi37 roffi37 commented Oct 9, 2023

No description provided.

Copy link

@RabenkoYevhenii RabenkoYevhenii left a comment

Choose a reason for hiding this comment

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

It`s ok. You can try also create method smth like "taking_damage" for the Animal, and just call it in the end of your staticmethod instead of using nested check

app/main.py Outdated

def dead(self) -> None:
if self.health <= 0:
self.alive.remove(self)

Choose a reason for hiding this comment

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

u should to use class name instead of self)

Copy link
Author

Choose a reason for hiding this comment

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

ok, but could you explain why?)

Choose a reason for hiding this comment

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

`couse alive its class atribute but not object of class)

app/main.py Outdated
self.name = name
self.health = health
self.hidden = hidden
self.alive.append(self)

Choose a reason for hiding this comment

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

The same about self, use class name instead

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