Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python print class variables

# to print out the variable names
print(vars(YourClass))

# to print out names and values
for var in vars(YourClass):
    print(getattr(YourClass, var))
 
PREVIOUS NEXT
Tagged: #python #print #class #variables
ADD COMMENT
Topic
Name
6+9 =