python乾貨整理之__str__

# Python乾貨整理之__str__node __str__是Python中類對象自帶的一個函數(經過其名字也能看出來,和__self__相似),那麼它有什麼做用呢?首先敲出下面的代碼運行一下看看結果是什麼:python class Person(object): def __init__(self, name = 'tom', age = 10): self.name
相關文章
相關標籤/搜索