Oops, try again. Make sure you've defined a new ElectricCar class after defining Car



I have reviewed my code too many times and cannot figure out what is causing this error to happen. Anyone to the rescue?

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 %d MPG." % (self.color, self.model, self.mpg)

    def drive_car(self):
        self.condition = "used"

class EletricCar(Car):
    def __init__(self, model, color, mpg, battery_type):
        self.model = model
        self.color = color
        self.mpg   = mpg
        self.battery_type = battery_type 
my_car = EletricCar("Camaro", "yellow", 77, "molten salt")


Just found out what the problem is: I misspelled the inherited class name.


it's ElectricCar not EletricCar