Question about Create an instance of a class


#1


Create an instance of a class

https://www.codecademy.com/courses/python-intermediate-en-egNXj/0/2?curriculum_id=4f89dab3d788890003000096

My error message is: "Oops, try again. You haven't created a Car object named my_car; make sure you create my_car after defining Car."

I expected to the code to run without any problems.


Replace this line with your code. 

class Car(object):
    my_Car = Car()


#2

you need a pass statement in between,

class Car(object):
    pass
my_Car = Car()

#3

Not quite


#4

Please help me with the error in the following code
class Car(object):
pass
my_Car = Car()


#5

Check capitalization. It's requesting an object named 'my_car'.


#6

What do you mean by,


#7

got, it should be
my_car = Car()


#8

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