Hello,
Im looking for a efficient way to print all of the class variables from a class. I now use the following code, that works, but doesn’t really look efficient.
for i in range(0, x):
print(ClassData[i].a)
print(ClassData[i].b)
print(ClassData[i].c)
I was thinking of looping through the variables, so you would loop from 0 to x and from a to c. Im not sure how to access those variable names within the class. Any suggestion might be appreciated, thanks.
3 posts - 3 participants