Skip to content

Instantly share code, notes, and snippets.

@highsmallxu
Last active July 19, 2020 03:00
Show Gist options
  • Save highsmallxu/0a951ed38977bda13f21aecd8c734b41 to your computer and use it in GitHub Desktop.
Save highsmallxu/0a951ed38977bda13f21aecd8c734b41 to your computer and use it in GitHub Desktop.
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