class Student(object): ... def init(self, name): ... self.name = name ... print(Student('Michael')) <__main__.Student object at 0x109afb190>
class Student(object): ... def init(self, name): ... self.name = name ... print(Student('Michael'))
<__main__.Student object at 0x109afb190>
为什么老师这段代码, 我在解释器里,写进去,就能正常运行 但是我单独存在.py里 然后运行就报错 TypeError: object() takes no parameters
Sign in to make a reply
冰糖is
为什么老师这段代码, 我在解释器里,写进去,就能正常运行 但是我单独存在.py里 然后运行就报错 TypeError: object() takes no parameters