8/11


#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 %s %s with %d MPG." %(self.color, self.model, self.mpg)
def drive_car(self):
self.conditon = "used"

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

ANYONE SEE MY MISTAKE I CAN'T FIGURE THIS OUT!!


#2
__init__(self, model, color, mpg):

The __init__() function needs the double underscores to work. Don't worry...I've done this more than once :smile:

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

You're supposed to print inside of the function for this lesson but it would work either way!
Lastly, you don't need my_car.display_car() in this lesson. Hope this helps!

Here's my code if you want to see it:

class Car(object):
    condition = "new"
    def __init__(self, model, color, mpg):
        self.model = model
        self.color = color
        self.mpg   = mpg
        
    def display_car(self):
        print "This is a %s %s with %s MPG." %(self.color, self.model, self.mpg)
        
    def drive_car(self):
        self.condition = "used"

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