def __str__(self): return 内容 print(对象) 打印出来的就是return后面的内容 转载于:https://www.cnblogs.com/zmw-1997/p/9501290.html