6/11 can someone help me?


#1

this is my code:

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)

model= "DeLorean"
color= "silver"
mpg= 88

print my_car.condition
print my_car.model
print my_car.color
print my_car.mpg

i keep getting this error message: Traceback (most recent call last):
File "python", line 8, in
TypeError: object.new() takes no parameters

and: Oops, try again. Make sure you pass the self keyword to the init() function.


#2

try this

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

it just probably you indents and the init method