输入结果有误
为什么执行老师的程序,class OldStyle: def _init_(self,name,description): self.name=name self.description=description class NewStyle(object): def _init_(self,name,description): self.name=name self.description=description if __name__=='_main_': old=OldStyle('old','OldStyle') print(old) print (type(old)) print(dir(old)) print('-------------------------------------') new=NewStyle('new','NewStyle') print (type(new)) print(dir(new))
编译成功,却没结果