How do you create different variable names while in a loop?

For example purposes… for x in range(0,9): string'x' = "Hello" So I end up with string1, string2, string3… all equaling “Hello” Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the … Read more

Instance variables vs. class variables in Python

I have Python classes, of which I need only one instance at runtime, so it would be sufficient to have the attributes only once per class and not per instance. If there would be more than one instance (which won’t happen), all instance should have the same configuration. I wonder which of the following options would be better or more “idiomatic” Python.