__str__ 方法

def __str__(self):
    return 内容


print(对象)

  

打印出来的就是return后面的内容

 

posted @ 2018-08-19 15:04  zmwzmw  阅读(70)  评论(0编辑  收藏  举报