Can't access parent member variable in Python
inheritance, python, scope
Solution
You're mixing up class and instance attributes.
print self._haircolor
Problem
I'm trying to access a parent member variable from an extended class. But running the following code... ``` class Mother(object): def __init__(self): self._haircolor = "Brown" class Child(Mother): def __init__(self): Mother.__init__(self) def print_haircolor(self): print Mother._haircolor c = Child() c.print_haircolor() ``` Gets me this error: ``` AttributeError: type object 'Mother' has no attribute '_haircolor' ``` What am I doing wrong?