Unless I'm missing something obvious (could well be the case), for the third line in the code below in the Inheritance exercise, the instructions do not state at any stage this syntax or its purpose, and unless one has worked with Python or other languages in the past, they won't get it. Of course once a student gets stumped enough to open the forums the answer is pretty evident, but it would be great to have this included in the lesson. Instructions below for reference:
"Create a class ElectricCar that inherits from Car. Give your new class an __init__() method of that includes a "battery_type" member variable in addition to the model, color and mpg. Then, create an electric car named "my_car" with a "molten salt" battery_type. Supply values of your choice for the other three inputs (model, color and mpg)."
And the hint:
Redefining a method of a "child" class is as simple as including a definition for that function inside the "child" class; this version will take precedence over the inherited version. Remember to include the self keyword as the first input when you define the __init__() method!
class ElectricCar(Car): def __init__(self, model, color, mpg, battery_type): Car.__init__(self, model, color, mpg) self.battery_type = battery_type