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

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

Solution #714

wants to merge 3 commits into from

Conversation

alex329657
Copy link

No description provided.

app/main.py Outdated
Comment on lines 28 to 29
for item in Animal.alive:
if item.name == animal.name:

Choose a reason for hiding this comment

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

Really is it possible that other hp can change?

Copy link
Author

Choose a reason for hiding this comment

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

do I need to check in some other way? the list always has 1 predator and 1 herbivore, can there be more?

@@ -15,7 +15,7 @@ def test_animal_class():


def test_animal_constructor():
lion = Animal("Lion King")
lion = Animal("Lion King", )

Choose a reason for hiding this comment

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

don't change this file

Copy link
Author

Choose a reason for hiding this comment

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

I don't know how I did it)

app/main.py Outdated
Comment on lines 23 to 28
if (animal.hidden or animal not in animal.alive
or not isinstance(animal, Herbivore)):
return
animal.health -= 50
if animal.health <= 0:
Animal.alive.remove(animal)

Choose a reason for hiding this comment

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

simplify this and get rid of return

Copy link
Author

Choose a reason for hiding this comment

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

I changed it, but I'm not sure that it's better

@alex329657 alex329657 requested a review from Yurnerroo October 9, 2023 10:48
Copy link

@Yurnerroo Yurnerroo 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.

3 participants