7. creating classes


#1

I read almost all topic but it still doesnt work.

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()

#2

here:

MPG. "

you have a space after the full stop, that shouldn't be


#3

thank you :smile: so much


#4