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

class Car(object):
    condition = "new"
    def __init__(self, model, color, mpg):
        self.model = model
        self.color = color
        self.mpg   = mpg
    def display_car(self):
        print "This is a " + self.color +" "+ self.model + " with " + str(self.mpg) + " MPG."
    def drive_car(self):
        self.condition = "used"
class EletricCar(Car):
    def __init__(self, model, color, mpg, battery_type):
        super(EletricCar, self).__init__(model,color,mpg)
        self.battery_type = battery_type
my_car = EletricCar("DeLorean", "silver", 88, "molten salt")


Although you code isn't well formatted, you should make sure you are not missing the double underscores before and after init.

Also, you should be swapping these lines:

and return the function with this line.

which is now at the end of the function.

I hope this helps! :wink:


Make sure you've defined a new ElectricCar class after defining Car.
why its giving this error message


@dasanan, you misspelled ElectricCar in all cases, correct it.

@bayoishola20, the __ dissapear if no markup is used. and don't understand this:

what does that mean?


Yeah, I know it will disappear that's why I started with "well formatted".

Any issue with using the return keyword to return the function? Or...???


Thank you for formatting your code. With the addition @stetim94 made, are you okay now? :wink:


again, what? which return? dasanan used super() to call the parent init method, which is perfectly valid (and done correctly)


Okay! :no_mouth: :no_mouth:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.