Python 實例變量、類變量、靜態變量 (十九)

實例變量python 實例變量則是覺得self.開頭,必須在實例化該類後使用 code class Test(object): def __init__(self): self.a = "Hello world!" def test(self): #在內部Test.a是不能訪問類變量的 print self.a A = T
相關文章
相關標籤/搜索