[ [ [] * y for y in range(3) ] * x for x in range(2) ]

Marcel marcel_achim at videotron.ca
Wed Jan 29 23:34:05 EST 2003


Hi,

I'm trying to allocate nested lists up-front using the subject line,
instead of generating :
[ [ [], [], [] ], [ [], [], [] ] ]
I end up with  :
[ [], [ [], [], [] ] ]

I guess I screwed up something, but I'm failing to understand what...

Any idea ?

thanks
Marcel




More information about the Python-list mailing list