I would like to give some feedback about ...
Please help
I don't understand why I get that """ TypeError: <class 'dict'> is wrong data type """ from next code:
on my PC all seems to work properly
class Warrior:
def __init__ (self):
self.health=50
self.attack_damage=5
def is_alive(self):
return self.health>0
class Knight(Warrior):
def __init__ (self):
self.health=50
self.attack_damage=7
def is_alive(self):
return self.health>0
def fight(unit_1, unit_2):
while unit_1.is_alive() and unit_2.is_alive():
unit_1.health-=unit_2.attack_damage
unit_2.health-=unit_1.attack_damage
return unit_1.is_alive() and not unit_2.is_alive()
Created at: 2019/03/10 07:41; Updated at: 2019/03/10 11:13