Use self to reference properties : Self : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Self »

 

Use self to reference properties


class C1():                      
    def setname(self, who):      
        self.name = who          

I1 = C1(  )                      
I2 = C1(  )
I1.setname('A')               
I2.setname('B')               
print I1.name



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Self