class FirstClass: def setdata(self, value): self.data = value def display(self): print self.data class SecondClass(FirstClass): def display(self): print 'Current value = "%s"' % self.data z = SecondClass( ) z.setdata(42) z.display( )
Name (required)
email (will not be published) (required)
Website