The difference is that if a variable is declared inside the __init__ constructor, the variable is different for different class variables. (ie) If a class has two objects, each of them has a different memory space for this variable. If it is declared as empcount , then the same memory space will be shared or available for all objects of the class. In this case, each created object increases the value of empcount by 1. Therefore, when a variable should be used by all objects, use this type of static declaration. But changing this variable affects all objects in the class.
source share