Missing Something Simple

John Abel jabel at plus.net
Tue Jul 12 09:44:00 EDT 2005


Hi,

I have a list of variables, which I am iterating over.  I need to set 
the value of each variable.  My code looks like:

varList = [ varOne, varTwo, varThree, varFour ]

for indivVar in varList:
    indivVar = returnVarFromFunction()

However, none of the variables in the list are being set.  I thought of 
using setattr, but this code sits in a function, and not class, so I'm 
unsure what the object would be.

I'm hoping someone can point me in the right direction.

John



More information about the Python-list mailing list