Initializing a class in Lesson Classes

I followed both instructions but on both exercises I keep getting that error message
I dont see anything wrong …can someone please help .

1 Like

This is because on line 3 you have already created the my_car instance of car. If you delete line 3 and 4 you should be fine.

Also, you must place your init function inside your Car class. so tab it over and take out some white space :slight_smile: .

Hope this helps :sunny:

1 Like

thanks man but im getting an error on the next excercise as well similar one can you tell me whats wrong here ?

Your code should look like 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)  
`Your print statements here`
1 Like

i just got it
thanks all the same bro