Variable definition

Raphael Mayoraz maygeo at netplus.ch
Fri Feb 26 18:32:27 EST 2010


Hello,

I'd like to define variables with some specific name that has a common 
prefix.
Something like this:

varDic = {'red': 'a', 'green': 'b', 'blue': 'c'}
for key, value in varDic.iteritems():
    'myPrefix' + key = value

I know this is illegal, but there must be a trick somewhere.

Thanks,

Raphael






More information about the Python-list mailing list