We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 287478d commit 0e406c9Copy full SHA for 0e406c9
app/main.py
@@ -22,16 +22,15 @@ def __repr__(self) -> str:
22
23
class Carnivore(Animal):
24
@classmethod
25
- def bite(cls, animal_herbivore: Herbivore) -> None:
+ def bite(cls, herbivore: Herbivore) -> None:
26
if (
27
- isinstance(animal_herbivore, Herbivore)
28
- and not animal_herbivore.hidden
+ isinstance(herbivore, Herbivore)
+ and not herbivore.hidden
29
):
30
- animal_herbivore.health -= 50
+ herbivore.health -= 50
31
32
- index = cls.alive.index(animal_herbivore)
33
- if animal_herbivore.health <= 0:
34
- del cls.alive[index]
+ if herbivore.health <= 0:
+ cls.alive.remove(herbivore)
35
36
37
class Herbivore(Animal):
0 commit comments