The directions instruct us to call the drive_car() function/method. However, the code only works once 'drive_car(my_car)' or 'drive_car()' is deleted (I've tried both). I get the following error message:
Traceback (most recent call last):
File "python", line 15, in
NameError: name 'drive_car' is not defined
Clearly drive_car is defined on line 9.... But I am obviously missing something. Can you help?
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, str(self.mpg)) def drive_car(self): self.condition = "used" return self.condition my_car = Car("DeLorean", "silver", 88) print my_car.condition drive_car() print my_car.drive_car()