>>> type(c)
<class 'int'>
>>> c
3
>>> type(c.__str__())
<class 'str'>
python中 方法名如果是 __xxx__() 的,那么就有特殊的功能,叫做“魔法”方法
__str__方法需要返回一个字符串,当做这个对象的描写
>>> type(c)
<class 'int'>
>>> c
3
>>> type(c.__str__())
<class 'str'>
python中 方法名如果是 __xxx__() 的,那么就有特殊的功能,叫做“魔法”方法
__str__方法需要返回一个字符串,当做这个对象的描写