[Tutor] Lists on the fly?

Carlos carloslara at web.de
Fri Dec 22 17:26:59 CET 2006


I am wondering if it is possible to create lists on the fly. The script 
that I'm working on needs a number of parameters, one of those is 
population, and this corresponds to the number of solutions that a 
genetic algorithm generates on each generation (iteration). The thing is 
that I need to generate one list for each population member and then 
append the corresponding population members to that particular list.

This is only so you can have an idea:

for i in range(5):
    'list_%i' % (i) = []


for i in range(5):
    lista_+'%i' % (i) = []


Is this possible?

Thanks in advance,
And Merry Christmas,

More information about the Tutor mailing list