class Road(object): # supply 'object' for class that will be inherited def __init__(self, name, lanes): # 'parent' class constructor self.name = name self.lanes = lanes class Interstate(Road): # Interstate inherits from Road def __init__(self, name, lanes, toll): # Child class constructor (Interstate) self.toll = toll # toll is part of child class super(Interstate, self).__init__(name, lanes) # call parent constructor for name and lanes mainSt = Road("Main St.", 3) # construct an object of the parent class print mainSt.name, mainSt.lanes I90 = Interstate('NY Thruway', 6, True) # construct an object of the child class print I90.name + " has " + str(I90.lanes) + ' lanes and toll == ' + str(I90.toll)