Member variables that are arguments of the init function have to be defined within the function as self.variable = variable. Is this still the same with member variables outside of the init function? If not, why?
For example, in my code, the member variable condition does not have to be defined as self.condition in the init function. Why is this?
class Car(object): condition = "new" def __init__(self, model, car, mpg): self.model = model self.car = car self.mpg = mpg my_car = Car("DeLorean", "silver", 88) print my_car.condition