1/6 Test Cases Passed
You need to earn 2 or 3 stars in order to submit.
1/6 Test Cases Passed
You need atleast 2 stars to grade your answer.
import random class Peon: def __init__(self): self.hp = 100 def takeDamage(self, dmg): self.hp = self.hp - dmg def returnHP(self): return self.hp # note that we're creating a new class Warrior that EXTENDS from an existing class Peon class Warrior(Peon):
warrior1 = Warrior() warrior2 = Warrior()
Test Cases (0/6)
-
warrior1.returnHP() to return 200
-
warrior1.armor to return 70
-
(warrior1.attack() >= 10) to return True
-
(warrior1.attack() <= 20) to return True
-
warrior1.returnHP() to return 170.0
-
warrior1.returnHP() to return 140.0
warrior1.takeDamage(100)
warrior1.takeDamage(200)