Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python set class variable

class MyClass:
    static_elem = 123 # This is a static element belonging to the class

    def __init__(self):
        self.object_elem = 456 # This is an instance / object element
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #set #class #variable
ADD COMMENT
Topic
Name
4+7 =