My first stumbling block with Python

Mr. Neutron nicktsocanos at charter.net
Thu Aug 22 19:46:17 CEST 2002


On Thu, 22 Aug 2002 10:36:44 -0400, Martin Franklin wrote:

> 
> If I am being silly then you could also take a look at the array built
> in module:-
> 
No not being silly but array is a single dimensional array. I needed
multiple dimensional arrays.

The answer is
	MyArray = [ [0]*512 for i in range(512) ]

I found this to be really peculiar and hard to understand. I have had to
think about it for a while and I am off to Python.org to read Guido's
tutorials on lists.

However it sparks an interest in my mind when I look at it. I wonder how
much expression I have in generating lists when doing this. I
can obviously put some type of program statement into it's generation.
It makes me wonder how many other tricks there are with lists.



More information about the Python-list mailing list