Created
September 27, 2017 23:11
-
-
Save Gwith/d6a12fb40d1723ecb11137f8d0a83473 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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