阅读背景:

使用Python类的 __init__( ) 函数定义成员变量

来源:互联网 
class Test():
    def __init__(self,s,i):
        self.s = s
        self.i = i           
        
    def excute(self):
        self.s+=" world"
        self.i+=1
        print self.s
        print self.i
        
        
t = Test("hello",2016)
t.excute()class Test():
    def __init__(self,s,i):
     



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: