Commit 3bf087e6 by BellCodeEditor

auto save

parent 82b025a3
Showing with 18 additions and 0 deletions
class Person:
def __init__(self,name,age):
self.name=name
self.age=age
class Teacher(Person):
def __init__(self,name,age,subject):
self.subject=subject
def skill(self,subject):
print('教'+subject)
teacher=Teacher('王老师',25,'英语')
teacher.skill('英语')
class Student(Teacher):
def __init__(self,namee,age,subjct):
super().skill(subject)
print('学习'+subject)
xiaoli=Student('小李',12,'英语')
xiaoli.skill('英语')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment