class MixedNames: # define class data = 'spam' # assign class attr def __init__(self, value): # assign method name self.data = value # assign instance attr def display(self): print self.data, MixedNames.data # instance attr, class attrx = MixedNames(1) # y = MixedNames(2) # x.display() y.display() # self.data differs, Subclass.data same
Name (required)
email (will not be published) (required)
Website