Overriding methods indentation error but cant figure!?


#1



#Indentatin error raises. I have tried moving the child class all over but no cigar
class Car(object):
    condition = "new"
    def __init__(self, model, color, mpg):
        self.model = model
        self.color = color
        self.mpg   = mpg
    
    def drive_car(self):
        self.condition = "used"
    
    def display_car(self):
        return "This is a %s %s with %s MPG." % \
        (self.color, self.model, self.mpg)
        
    class ElectricCar(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 = ElectricCar("Cayanne", "brown", 88, "molten salt")
    
        def drive_car(self):
            self.condition = "like new"

print my_car.condition
my_car.drive_car()
print my_car.condition


#2

This line should be moved down four lines.


#3

Thank you but it came back with same error


#4

I can test your code if you will provide a link to the exercise, please. Thank you.


#5

Thanks I appreciate that

https://www.codecademy.com/en/courses/python-intermediate-en-egNXj/1/4?curriculum_id=4f89dab3d788890003000096


#6

Having moved the above mentioned line down, all that remains is to take four spaces out of the indentation for all the lines beginning with ElectricCar class. See what I mean?


#7

class ElectricCar(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 = ElectricCar("Cayanne", "brown", 88, "molten salt")

def drive_car(self):
    self.condition = "like new"

print my_car.condition
my_car.drive_car()
print my_car.condition