10/11 overriding methods


#1

Please help.

This is my problem > "Oops, try again.
It looks like you didn't update the condition of my_car to 'like new'."

and my code is below.

I've looked for so long for the solve for this, if you could help me and tell me what I did wrong, I would be much appreciate!


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, self.mpg)
    def drive_car(self):
        self.condition = "used"

my_car = Car("DeLorean", "silver", 88)
print my_car.condition

my_car.drive_car()

print my_car.condition

class ElectricCar(Car):
   def __init__(self, model, color, mpg, battery_type):
    Car.__init__(self, model, color, mpg)
    self.battery_type = battery_type
    def drive_car(self):
        self.condition = "like new"



my_car = ElectricCar("toyota", "white", 420, "molten salt")

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


#2

NEVERMIND

Indentation was the problem.