class testStr:
pass
__str(self)__:
print("hahhaha")
pass
test=testStr()
print(test)
输出结果:
hahahhaha
扫描二维码关注公众号,回复:
4798887 查看本文章
class testStr:
pass
__str(self)__:
print("hahhaha")
pass
test=testStr()
print(test)
输出结果:
hahahhaha