What's wrong with this code?


#1

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 "+self.color+" "+self.model+" with "+str(self.mpg)+" MPG"
my_car = Car("DeLorean", "silver", 88)
print my_car.display_car()


#2

I would use %s instead of "+".
My code says:

return "This is a %s %s with %s MPG." % (self.color, self.model, str(self.mpg))