How Do I...?

Victor Subervi victorsubervi at gmail.com
Fri Dec 18 13:55:09 EST 2009


Hi;
I have this code:

    i = 0
    nameNos = []
    nos = []
    for option in ourOptions():
      nameNos.append('optionNo%d' % i)
      nos.append(i)
      i += 1

The idea is that through every iteration of option, I can create a new
variable such as 'optionNo0', 'optionNo1' etc and assign values such as '0',
'1' etc to them. Of course that code doesn't work. What would?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091218/1103836a/attachment-0001.html>


More information about the Python-list mailing list