Hello, I keep getting the following message:
Traceback (most recent call last):
File "python", line 15, in
AttributeError: 'Car' object has no attribute 'display_car'
Could someone please explain what is wrong with this code?
class Car(object): condition = "new" def __init__(self, model, color, mpg): self.model = model self.color = color self.mpg = mpg my_car = Car("DeLorean", "silver", 88) print my_car.condition print my_car.model print my_car.color print my_car.mpg def display_car (self): print ( "This is a %s %s with %s MPG."%(self.color, self.model, self.mpg)) my_car = Car("DeLorean", "silver", 88) print my_car.display_car()