This can't be happening!


I don't know how or why I am stuck here but please help me! This is the error:
You haven't created a Car object named my_car; make sure you create my_car after defining Car.

class Car(object):
    my_car = Car()


you first need to create the class, and then after the class create the instance

remember: classes can't be empty/have no content. Look in the instructions for what you should put as class content


These are the instructions: Instructions
Below your Car class, create a new object named my_car that is an instance of Car.


but you created the instance inside the class, not below/after, which is not what you should do.

classes are like blueprints, then the instances are the things build from the blue print

so for example before a house is build, a blueprint is created (class) and then after the blueprint is finished, they start building the actual house (class instance)

what you did, is like trying to build a house while still working on the blueprint.


And how can I finish the blueprints first?


finish the class, before creating an instance.

In python, what determines if something is nested inside a class?


How the code should look, because I have no clue what's is going on!


i guess i would just have to answer my own question

indent determines what is nested inside or outside a class (just like loop, functions and so on), so if we want to create the instance outside the class, how much indent should it have?


class Car(object):

my_car = Car()


very good, but you forgot a piece of information i already gave you:


AAAAAAAAAAAAAAAAAAAAAAAAAA :@ :@... Anyway now I got it! Thank you so much for the explanation! Instances are outside the class, gotta remember it!


you're welcome

Yep, just think about the blueprint, you don't start building a house before you finished a blueprint


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