python干货整理之__str__

# Python干货整理之__str__node __str__是Python中类对象自带的一个函数(经过其名字也能看出来,和__self__相似),那么它有什么做用呢?首先敲出下面的代码运行一下看看结果是什么:python class Person(object): def __init__(self, name = 'tom', age = 10): self.name
相关文章
相关标签/搜索