Given the code:
class Character():
def __init__(self, name):
self.name = name
self.health = 50
self.damage = 10
class Warrior(Character):
def __init__(self, name, weapon, armor):
super(Character).__init__()
self.weapon = weapon
self.armor = armor
self.strength = 10
self.dexterity = 5
self.intelligence = 5
Doug = Character("Doug")
Mark = Warrior("Mark", "Axe", None)
Why doesn't the Warrior
class inherit the health
from the Character
class?
What would I need to do differently to be able to print Mark.health
?