Python3中__str__的用法

__str__方法: 使用:如: class Car:     def __init__(self, newWheelNum, newColor):         self.wheelNum = newWheelNum         self.color = newColor     def __str__(self):         msg = "嘿。。。个人颜色是" + self.col
相关文章
相关标签/搜索