m0_68760792
2022-04-24 20:49
采纳率: 50%
浏览 29

我是初学者,能力有限,找半天找不出原因,望解惑

class Student(object):
def init(self,name,age):
self.name = name
self.age = age
def info (self):
print(self.name,self.age)
class Student1(object):
def init(self,name,age,value):
super().init(name,age)
self.value = value
class Student2(object):
def init(self,name,age,height):
super().init(name,age)
self.height = height
x = Student1('张三',20,30)
y = Student2('李四',38,32)
x.info()
y.info()

1条回答 默认 最新

相关推荐 更多相似问题