class Car(object): condition = "new" def __init__(self, model, color, mpg): self.model = model self.color = color self.mpg = mpg def display_car(self, model, color, mpg): print "This is a " + str(self.model) + " " + str(self.color) + " with " + str(self.mpg) + " MPG" my_car = Car("DeLorean", "silver", 88) print my_car.condition my_car.display_car(my_car.color, my_car.model, my_car.mpg)
error msg: Oops, try again. Make sure you pass the self keyword to the display_car() method.
but code prints "new
This is a DeLorean silver with 88 MPG
None" and it is correct!