Initializing a class? Invalid syntac but i still passed. Why is that?


#1


https://www.codecademy.com/courses/python-intermediate-en-egNXj/0/5?curriculum_id=4f89dab3d788890003000096#


Replace this line with your code. Do not remove the backticks that are above or below this line.

class Car(object):
    condition = "new" #this is called member variable

    def __init__(self, model, color, mpg):
        self.model = model
        self.color = color
        self.mpg = mpg
my_car = Car("DeLorean", "silver", 88)      print my_car.self


#2

You can't call self on the print statement, this line:

print my_car.self

you could call my_car.model, or color or even mpg. But not self, you can read about self here.

Codecademy checks if the requirement for the lesson is met, and you did.