11.8 'return' outside function and Did you accidentally delete my_car?


#1
`class Car(object):
    condition = "new"
    def __init__(self, model, color, mpg, condition):
        self.model = model
        self.color = color
        self.mpg   = mpg
        self.conditon = condition
    def display_car(self):
        return "This is a " + self.color + " " + self.model + " with " + str(self.mpg) + " MPG."
    def drive_car(self):
        self.condition = "used"   
my_car = Car("DeLorean", "silver", 88, "used")

return self.condition()
print my_car.condition()
my_car.drive_car()
print my_car.condition()`

The 'return' outside function references Line 14. Where have I erred?indent preformatted text by 4 spaces


#3

I'm not sure how to format code. I'll look it up. Okay. I used the </> button for code formatting, but my code still didn't keep its formatting. Then I went back and highlighted my code. Then the formatting button worked. Everything's hard until you know and easy afterwards.