Two-dimensional arrays

Peter Slizik peter.slizik at pobox.sk
Tue May 27 04:36:50 EDT 2003


Thank you all for your answers.

I'm really thankful for this solution:
 > You might use:
 >
 >   array = [[0]*dim for row in range(dim)]
which is the one I really wouldn't think about;
and I'm also thankful for directing my attention to the Python FAQ, 
which is, I think, the only website on Python I didn't read. ;-)

But I want to ask: When does Python merge two same objects into one and 
when does it treat as two different objects? Is there any general rule?

Peter





More information about the Python-list mailing list