The code below is returning the following error: TypeError: drive_car() takes no arguments (1 given)
I cannot for the life of me decipher why. The final three lines of code are in fact a copy/paste from lesson 8 of this section, where it worked just fine.
Any input would be much appreciated.
EDIT: just noticed that in the child class, condition should be self.condition, and I corrected that, but it's still returning the same error.
class Car(object): condition = "new" def __init__(self, model, color, mpg): self.model = model self.color = color self.mpg = mpg def display_car(self): return "This is a " + self.color + " " + self.model +" with " + str(self.mpg) +" MPG." def drive_car(self): self.condition = "used" class ElectricCar(Car): def __init__(self, battery_type, model, color, mpg): self.battery_type = battery_type super(ElectricCar, self).__init__(model, color, mpg) def drive_car(): condition = "like new" my_car = ElectricCar("molten salt", "Dodge","green", 100) print my_car.condition my_car.drive_car() print my_car.condition