Created
December 23, 2022 22:11
-
-
Save loisgh/69249d6d4ed059c6fdf21997713dd662 to your computer and use it in GitHub Desktop.
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 FirstClass(): | |
myclass_variable = "Here is some data" | |
def method_one(self): | |
print("You are in FirstClass method_one") | |
def method_two(self): | |
print("You are in FirstClass method_two") | |
print("My Class Variable: {}".format(FirstClass.myclass_variable)) | |
class SecondClass(FirstClass): | |
myclass_variable = "Here is some data from the SecondClass Method" | |
def method_one(self): | |
super().method_one() | |
print("You are in SecondClass method_one") | |
def method_two(self): | |
super().method_two() | |
print("You are in SecondClass method_two") | |
print("My Class Variable: {}".format(SecondClass.myclass_variable)) | |
if __name__ == '__main__': | |
print("**********************************") | |
print("FROM THE FIRST CLASS METHOD") | |
print("**********************************") | |
FirstClass.myclass_variable | |
f = FirstClass() | |
f.method_one() | |
f.method_two() | |
print("**********************************") | |
print("FROM THE SECOND CLASS METHOD") | |
print("**********************************") | |
s = SecondClass() | |
s.method_one() | |
s.method_two() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment