my code looks as follows (sorry, didnt know how to format it the right way, so i added "(tab)" where 4 spaces should be instead).
(tab) condition = "new"
(tab) def init(self, model, color, mpg):
(tab)(tab) self.model = model
(tab)(tab) self.color = color
(tab)(tab) self.mpg = mpg
my_car = Car(model, color, mpg)
model = "DeLorean"
color = "silver"
mpg = 88
I get the following Error when clicking next, but codecademy still accepts it as correct and lets me proceed:
Traceback (most recent call last):
File "python", line 8, in
NameError: name 'model' is not defined
Can anyone of you help me? The concept of classes I think I understood. Problem for me at the moment is to understand the self argument and when to put self.something or (class_name).something and when not. If I try to follow the code one step at a time and try to understand it, I quite cant manage it. It seems like it functions differently from functions that i have learned before. Maybe one of you could give me some more insight in this too.
I appreciate all your efforts to help me improve and thank you in advance,