class NextClass: # define class def printer(self, text): # define method self.message = text # change instance print self.message # access instancex = NextClass() # make instancex.printer('instance call') # call its methodprint x.message # instance changedNextClass.printer(x, 'class call') # direct class callprint x.message # instance changed again
Name (required)
email (will not be published) (required)
Website