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


#1



https://www.codecademy.com/courses/python-intermediate-en-egNXj/1/3


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")


#2

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


#3

it's ElectricCar not EletricCar