Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 16:11, Franz Kelnreiter wrote: > On Thu, Apr 11, 2013 at 2:57 PM, Thomas Goebel < > thomas.goe...@ohm-hochschule.de> wrote: > >> ... >> Which is the same as: >> f = {'list_' + str(n):[m for m in range(3)] for n in range(3)} >> >

Re: Fwd: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 14:11, Franz Kelnreiter wrote: > On Thu, Apr 11, 2013 at 1:46 PM, Thomas Goebel wrote: > >> global_list = {'_'.join(['list', str(i)]):[] for i in range(20)} > > Thanks for your explanation, I think I know what you want to do and I would >

Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 11/04/2013 14:11, Franz Kelnreiter wrote: > On Thu, Apr 11, 2013 at 1:46 PM, Thomas Goebel wrote: >> >> the difference between your and my code is that >> >> global_list = {'_'.join(['list', str(i)]):[] for i in range(20)} >> >>

Re: use a loop to create lists

2013-04-11 Thread Thomas Goebel
* On 10/04/2013 10:40, martaamu...@gmail.com wrote: > Hi! > > I would like to create a list containing lists. I need each list to > have a differente name and i would like to use a loop to name the > list. > [...] > global_list=[] > for i in range (20): > ("list_"+i)=[] #These would be the n