This code gives error. Please help me


#1

The below code is giving error . though output is correct.

its giving error as "Oops, try again. It looks like you didn't update the condition of my_car to 'like new'."

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 %s %s with %d MPG." %(self.color,self.model,self.mpg)
    def drive_car(self):
        self.condition="used"
        



class ElectricCar(Car):
    def __init__(self,battery_type,model,color,mpg):
        self.battery_type=battery_type
        self.model=model
        self.color=color
        self.mpg=mpg
    def drive_car(self):
        self.condition="likenew"
        
        
my_car = ElectricCar("molten salt","DeLorean", "silver", 88)
print my_car.condition
my_car.drive_car()
print my_car.condition

#2

like new are two words, not one?


#3

Thank you. thats a silly one :slight_smile:


#4