#Author:  James Tam
#Version: June 12, 2023

#Learning objectives:
#How to have attributes and methods become available in all class definitions
#that are derived from a parent class.

class Parent():
    def __init__(self):
        self.a = 1
        self.b = 2
        
    def display(self):
        print(self.a,self.b)


class Child(Parent):
    def __init__(self): 
        super().__init__()
        super().display()
        self.c = "Attribute is unique to child"
        
    def displayUnique(self):
        print(self.c)


def start():
    print("Parent")
    aParent = Parent()
    aParent.display()
    print(aParent.a,aParent.b)

    print("\nChild")
    aChild = Child()
    aChild.display()
    print(aChild.a,aChild.b,aChild.c)

    #Error: parent has no such attribute print(aParent.c)
    #Error: parent has no such method aParent.displayUnique()

start()
