Create multiple variables (with a loop?)

Chris Rebert clp2 at
Fri Jun 5 21:57:52 EDT 2009

On Fri, Jun 5, 2009 at 6:44 PM, Gökhan SEVER<gokhansever at> wrote:
> You could use locals() for dynamic variable names creation.

Not really. Quoting (emphasis mine):

    Update and return a dictionary representing the current local symbol table.
    Note: The contents of this dictionary should not be modified;
**changes may not affect the values of local variables used by the

It does happen to work it certain cases, but it should not be relied upon.


More information about the Python-list mailing list