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

task completed #581

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

task completed #581

wants to merge 5 commits into from

Conversation

andriy-py
Copy link

No description provided.

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

Choose a reason for hiding this comment

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

Suggested change
self.__class__.alive.append(self)
self.alive.append(self)

__class__ is redundant

Choose a reason for hiding this comment

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

Fix in other places

Choose a reason for hiding this comment

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

not fixed

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

Choose a reason for hiding this comment

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

not fixed

app/main.py Outdated
Comment on lines 23 to 25
return f"{{Name: {self.name}," \
f" Health: {self.health}," \
f" Hidden: {self.hidden}}}"
Copy link

Choose a reason for hiding this comment

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

better to use () then \

app/main.py Outdated
"""
Class representing an animal.
"""
alive: List["Animal"] = []
Copy link

Choose a reason for hiding this comment

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

Suggested change
alive: List["Animal"] = []
alive: List[Animal] = []

app/main.py Outdated
If the health is 0 or less, remove the animal from the alive list.
"""
if self.health <= 0:
self.__class__.alive.remove(self)
Copy link

Choose a reason for hiding this comment

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

Suggested change
self.__class__.alive.remove(self)
self.alive.remove(self)

@andriy-py andriy-py requested a review from vsmutok January 8, 2024 09:39
Copy link

@ArsenPidhoretskyi ArsenPidhoretskyi left a comment

Choose a reason for hiding this comment

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

Well done!

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