Creating class methods


#1



in creating class method, class lesson no. 7


my code is complete and it even prints what needed to be printed but it throws an error message which says

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


but it did print...


Replace this line with your 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()


#2

The subtle difference is the full stop at the end.


#3

i'll just go ahead and jump down a cliff now... #facepalm

P.S thx btw


#4

Nothing so drastic as that... Just add it to your check list...

* used exact strings given

#5

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