python中_str_使用方法

定义__str__()方法: class Car:python       def __init__(self, newWheelNum, newColor):spa         self.wheelNum = newWheelNumxml         self.color = newColor对象       def __str__(self):ci         msg = "嘿。。
相关文章
相关标签/搜索