5/11


#1

Can anybody help me with this as i am unsure where i have gone wrong and do not know how to correct it
Thanks in advance


#2

You need to override your class's __init__, currently you are using the default one which does not take arguments.


#3

Ok, could you please explain how to do this as i am unsure on how to do this
Thanks for your help


#4

Add an __init__ method to your class


#5

Ok thank you for your help


#6

Did you get it sorted out? I'm very intentionally avoiding telling you why what you have is incorrect and exactly how to fix it - I much prefer to lead your own reasoning a bit, I realize that can be a little frustrating at times, so I wanna make sure that you're not giving up on me :stuck_out_tongue:


#7

Haha i am halfway there now i only have this error coming up:


#8

No, nope, that's half a step further away!

So the issue is that you have not added __init__ to your class. Right. That is why it falls back on object.__init__ as you can tell from your first error message.

You have something called __init__.. Why is it not recognized as part of the class? Which part of your code is in the class, where does the class end?


#9

Not sure why my code passed and yet there's still a syntax error in the output, even after I refreshed the browser.


#10

On line 7 cancel the word "def".
Then cancel line 9, 10, 11.


#11

I admire your approach to helping people, but I have the exact same code as OP and am completely lost

I honestly don't know the answers to any of these questions; I don't even know where to start in answering them.


#12

I follow your order but not work for me


#13

Watch your indentation.

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.model
print my_car.color
print my_car.mpg