-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
task completed #581
Conversation
app/main.py
Outdated
self.name = name | ||
self.health = health | ||
self.hidden = False | ||
self.__class__.alive.append(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.__class__.alive.append(self) | |
self.alive.append(self) |
__class__
is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix in other places
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
return f"{{Name: {self.name}," \ | ||
f" Health: {self.health}," \ | ||
f" Hidden: {self.hidden}}}" |
There was a problem hiding this comment.
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"] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.__class__.alive.remove(self) | |
self.alive.remove(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
No description provided.