In the creating class methods exercise, I keep getting this error message:
Traceback (most recent call last): File "python", line 11, in <module> File "python", line 8, in display_car TypeError: not all arguments converted during string formatting
But in my code, I use str() with mpg…do I have it in the wrong place? Or is something else wrong in my code?
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)) my_car = Car("DeLorean", "silver", 88) print my_car.display_car()