2.creating instance of a class


class Car(object):
    my_car =  Car()

Oops, try again. You haven't created a Car object named my_car; make sure you create my_car after defining Car.


currently, your Car object my_car is part of Car. Place my after/outside after defining Car.

Hint: python relies on indention to determine what is inside a class.


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