Q:

Setting class variable value using self. versus classname

In python class (say class C) lets say we have class variable V = 0. Lets say this is a counter that keeps track of how many objects of the class have been created.
In the init methid, say we want to fetch the class variable value. We can do this either by writing C.V or self.V - assuming both do exactly the same thing.
To set the value of this class variable, there are same 2 options so what is the difference of using:
C.V += 1 versus self.V += 1 
Is it that using self will update the variable at that object level and other objects wont get the change? Or do both approach behave the same.

A:

Setting C.V refers to the class's definition. This will set the value for all objects of the same class. Using self refers to the current instance, or object, of that class. This will not affect other objects of the same class.
EDIT -- Credits to @Jdw136
And adding on to what @CalderWhite said, when you use a normal variable in a class (C.V), that variable is shared among all instances of that class. On the other hand when you use the self. Method (self.V), each instance of that object gets its own variable all to itself. Keeping this in mind, you can use this knowledge to avoid creating the same variable in the stack over and over.

