Instance Objects Are Concrete Items : Instance : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Instance »

 

Instance Objects Are Concrete Items


class FirstClass:                  
    def setdata(self, value):      
        self.data = value    
    def display(self)
        print self.data      

x = FirstClass(  )                 
y = FirstClass(  )                 

x.setdata("A")               
y.setdata(3.14159)           
x.display(  )                
y.display(  ) 
x.data = "New value"               
x.display(  )                
x.anothername = "spam"



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Class
» Instance