How Do I...?

Victor Subervi victorsubervi at gmail.com
Fri Dec 18 14:51:04 EST 2009


On Fri, Dec 18, 2009 at 3:46 PM, Rami Chowdhury <rami.chowdhury at gmail.com>wrote:

> On Fri, Dec 18, 2009 at 10:55, Victor Subervi <victorsubervi at gmail.com>
> wrote:
> > 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.
>
> What are you expecting to do with those variables and values later?
>

:-} I discovered after I wrote this that all I had to do was use the length
of ourOptions. But it's an interesting academic question for future
reference ;/
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091218/f379f275/attachment.html>


More information about the Python-list mailing list