-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Need help with visualisation Animal.alive #753
base: master
Are you sure you want to change the base?
Conversation
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 flake8
thanks for help |
app/main.py
Outdated
if isinstance(another_beast, Carnivore) or another_beast.hidden: | ||
pass | ||
else: |
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.
if isinstance(another_beast, Carnivore) or another_beast.hidden: | |
pass | |
else: | |
if not (isinstance(another_beast, Carnivore) or another_beast.hidden): |
Simplify your code
app/main.py
Outdated
if self.hidden: | ||
self.hidden = False | ||
else: | ||
self.hidden = True |
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.
Write this inline, use not keyword
app/main.py
Outdated
class Herbivore(Animal): | ||
|
||
def hide(self) -> None: | ||
self.hidden = False if self.hidden is True else True |
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.
Use not keyword instead of if-else
Please check this job. |
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.
good job!
No description provided.