1. Inside ElectricCar add a new method drive_car() that changes the car's condition to the string "like new".
2. Then, outside of ElectricCar, print the condition of my_car
3. Next, drive my_car by calling the drive_car() function
4. Finally, print the condition of my_car again
I want to do 3, 4 but can't. Don't know what concept I am missing. It's quite stressful and keep coming back to the same point.
class Car(object): condition = "new" def __init__(self, model, color, mpg): self.mode = model self.color = color self.mpg = mpg def display_car(self): print ("This is a %s %s with %s MPG" % (self.model, self.color, self.mpg)) def drive_car(self): self.condition = "used" class ElectricCar(Car): def __init__(self, model, color, mpg, battery_type): Car.__init__(self, model, color, mpg) self.battery_type = battery_type def drive_car(self): self.condition = "like new" my_car = ElectricCar("Lexus", "black", 90, "molten salt") print (my_car.condition) my_car.drive_car.ElectricCar()