Referring to member variables


Oops, try again. my_car needs model, color and mpg member variables.

class Car(object):
    condition = "new"
    def __init__(self, model color, mpg):
        self.model = model
        self.color = color
        self.mpg = mpg

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


I think a comma is missing there, isn't it? :confused:


You're right, can't believe I missed that– thank you!


Sure thing! It happens to the best lol ^^


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