30
I have the Family and its inherited Person classes. How do I get the familyName attribute from the Person class?
class Family(object):
def __init__(self, familyName):
self.familyName = familyName
class Person(Family):
def __init__(self, personName):
self.personName = personName
For instance, let these Family and Person objects:
strauss = Family('Strauss')
johaness = Person('Johaness')
richard = Person('Richard')
I'd like to do something such as:
print richard.familyName
and get 'Strauss'. How can I do this?