coding=utf-8
class student(object):
"""docstring for student"""
def __init__(self, age, height):
self.age = age
self.height = height
print("student初始化")
def play(self):
print("学生爱好什么")
class hong(student):
"""docstring for hong"""
def __init__(self, age, height, sex = 'woman'):
super(hong, self).__init__(age, height)
self.sex = sex
print("hong初始化")
def play(self):
print("小红爱好画画")
class ming(object):
"""docstring for ming"""
def __init__(self, love):
self.love = love
print("ming初始化")
def play(self):
print("小明爱好打游戏")
class alllove(hong,ming):
"""docstring for alllove"""
def __init__(self):
super(alllove, self).__init__(age, love)
def play(self):
# super().play
print("大家的爱好就是这样")
alllove().play()
求指点这么写有什么错误啊· py3.6.2运行不行,本人小白,求教