If you want to print info about the DeLorean, it seems you need to use Python 3.0 print syntax


#1


https://www.codecademy.com/courses/python-intermediate-en-egNXj/1/1

I'd just like to point out that I managed to get past 7/11 (as if it were a puzzle in a video game) by changing the syntax of the print statement from that useful in Python 2.x to that used in Python 3. I had always been under the impression that the interpreter provided by Codecademy was 2.x compatible and, indeed, it has always behaved as such. Today, however, I discovered from reading the examples in the discussion section that in order to move onto 8/11, all I needed to do was enclose the strings to be printed in ( ). I spent almost two hours figuring that out. And, I had put off dealing with that for three days.

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, str(self.mpg)))

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

my_car.display_car()


#2

Python 2 syntax will work as well. You can remove the parentheses around the format string to submit this, which will be accepted ...

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

#3

Yeah, I agree. It USUALLY does. But, not for me, and not on this particular exercise.