Calling class member variables


#1



Each class object we create has its own set of member variables. Since we've created an object my_car that is an instance of the Car class, my_car should already have a member variable named condition. This attribute gets assigned a value as soon as my_car is created.


what does this line means " This attribute gets assigned a value as soon as my_car is created."


Replace this line with your code. 
class Car(object):
    condition="new"

my_car=Car()


#2

here:

class Car(object):

you create a class, but classes are like blue prints (in this case a blueprint for a car)

then when you create an instance of your car:

my_car=Car()

you actually build your blue print, so then you car is new. A drawing isn't a new car


#3

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