Forked from highsmallxu/inheritance-override-method.py
Created
July 19, 2020 03:00
-
-
Save mike11339/7ddf479ed5d8b413af069569f4192b66 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 Job: | |
def __init__(self, person_name): | |
self.name = person_name | |
def task(self): | |
print("working") | |
class Teacher(Job): | |
def task(self): | |
print("teach students") | |
teacher = Teacher("xiaoxu") | |
teacher.task() | |
# teach students |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment