Creating class methods


Getting a syntax error on line 11 after "my_car"

I have no idea what's causing a syntax error here....

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


Welp, figured it out. Because of the blocking on the window I couldn't tell I was missing a parenthesis.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.