How to create and use Static Class variables in Python?
Variables declared inside the class definition, but not inside a method are class or static variables.
class Employee: age = 25 print(Employee.age) e = Employee() print(e.age) e.age = 30 print(Employee.age) # 25 print(e.age) # 30
Sample output of above program.
25 25 25 30
2019-06-23T12:50:35+05:30
2019-06-23T12:50:35+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution