Last active
August 29, 2015 14:23
-
-
Save aaira-a/b3c0a18838b9fb9f79b8 to your computer and use it in GitHub Desktop.
python inheritance learning gist
This file contains 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 Parent(object): | |
def __init__(self, param1, param2): | |
self.param1 = param1 | |
self.param2 = param2 | |
def main(self): | |
print(self.name) | |
class Child1(Parent): | |
name = 'Child1' | |
class Child2(Parent): | |
name = 'Child2' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment