>>> class student:
def _init_(self,name,age):
self.name
self.age
def display(self):
return("this is a "+self.name+str(self.age))
>>> stu=student("chad",14)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object() takes no parameters
我想知道我哪里出错了,我该如何解决。
原文由 Ben 10 发布,翻译遵循 CC BY-SA 4.0 许可协议
尝试这个: