Discuss / Python / 报错

报错

Topic source

冰糖is

#1 Created at ... [Delete] [Delete and Lock User]

class Student(object): ... def init(self, name): ... self.name = name ... print(Student('Michael'))

<__main__.Student object at 0x109afb190>

为什么老师这段代码, 我在解释器里,写进去,就能正常运行 但是我单独存在.py里 然后运行就报错 TypeError: object() takes no parameters


  • 1

Reply