I've saw a lot of strange and kind of silly things in the forum. This exercise is for inheritance but everybody in the forum is just rewriting /self.model = model/ and etc. Which is not saving time and makes this exercise pointless. The other thing I saw is is deleting this: Car("DeLorean", "silver", 88), but I don't think this will be helpful in future plan! Can someone explain if I am missing something or something else is wrong! This is the error message I get:
Oops, try again. my_car does not appear to be an instance of ElectricCar.
I think my indentation is right but not a 100% sure...
Thanks for the time and thanks in advance!!
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 %s %s with %s MPG." % \ (self.color, self.model, str(self.mpg)) def drive_car(self): self.condition = "used" return self.condition my_car = Car("DeLorean", "silver", 88) print my_car.condition print my_car.drive_car() class ElectricCar(Car): def __init__(self, model, color, mpg, battery_type): self.battery_type = battery_type my_car = ElectricCar("Malibu 2.0", "blue", 120, "molten salt") print my_car