7 Creating Clas Methods


#1



I am getting this message "Oops, try again. It looks like you didn't print "This is a silver DeLorean with 88 MPG.".


My output looks like this--for the life of me, I can't see what's different and why I'm getting the error message:

Here is my code. I feel like I understood it and that my output is expected. Any idea what might be going on?


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 wtih %s MPG." % (self.color, self.model, str(self.mpg))

my_car = Car("DeLorean", "silver", 88)
print my_car.display_car()


#2

you misspelled with


#3

hallelujah!! That must be it! Thank you!!!


#4

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