Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mike11339/7ddf479ed5d8b413af069569f4192b66 to your computer and use it in GitHub Desktop.
Save mike11339/7ddf479ed5d8b413af069569f4192b66 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