python set class variable

Solutions on MaxInterview for python set class variable by the best coders in the world

showing results for - "python set class variable"
Marco
29 Feb 2017
1class MyClass:
2    static_elem = 123 # This is a static element belonging to the class
3
4    def __init__(self):
5        self.object_elem = 456 # This is an instance / object element