creating lists question?
wweston at att.net
Wed Mar 24 05:27:09 CET 2004
> I'm trying to create a series of list from a loop is this possible? Let me
> give you an example:
> list1 = ["aaa", "bbb", "ccc", "ddd", "eee"]
> for element in list1:
> a = element #a is one of the strings
> a =  #a is now an empty list; list1 is unchanged
> I want a new list created for every element in list1, how can I do this.
Let me just put comments on the for loop.
There has to be a better way/better result than having a
bunch of named lists. Maybe you want a list of a label-list;
list = 
list.append( ["aaa",] )
More information about the Python-list