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

Need help with visualisation Animal.alive #753

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

Conversation

Serhii-Hrynyshyn
Copy link

No description provided.

Copy link

@EdAlekseiev EdAlekseiev left a comment

Choose a reason for hiding this comment

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

Fix flake8

@Serhii-Hrynyshyn
Copy link
Author

thanks for help

app/main.py Outdated
Comment on lines 35 to 37
if isinstance(another_beast, Carnivore) or another_beast.hidden:
pass
else:

Choose a reason for hiding this comment

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

Suggested change
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
Comment on lines 25 to 28
if self.hidden:
self.hidden = False
else:
self.hidden = True

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

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

@Serhii-Hrynyshyn
Copy link
Author

Please check this job.

Copy link

@NikOneZ1 NikOneZ1 left a comment

Choose a reason for hiding this comment

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

good job!

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.

4 participants