Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created September 27, 2017 23:11
Show Gist options
  • Select an option

  • Save Gwith/d6a12fb40d1723ecb11137f8d0a83473 to your computer and use it in GitHub Desktop.

Select an option

Save Gwith/d6a12fb40d1723ecb11137f8d0a83473 to your computer and use it in GitHub Desktop.
class Character():
def __init__(self, level, strength=10, dexterity=10, intelligence=10, vitality=10):
self.strength = strength
self.dexterity = dexterity
self.intelligence = intelligence
self.vitality = vitality
class Mage(Character):
def __init__(self, mana, **kwargs):
super().__init__(**kwargs)
self.mana = mana
def attributes(self):
print('level {}'.format(self.level))
print('mana {}'.format(self.mana))
print('strength {}'.format(self.strength))
print('dexterirty {}'.format(self.dexterity))
print('intelligence {}'.format(self.intelligence))
print('vitality {}'.format(self.vitality))
test = Mage(1, 100, Strength=12, Dexterity=13, Intelligence=14, Vitality=11)
test.attributes()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment