Arrays? (Or lists if you prefer)

Hakusa at gmail.com Hakusa at gmail.com
Sun Oct 22 21:07:36 EDT 2006


Pythonic lists are everything I want in a one dimensional array . . .
but I'm trying to do a text adventure and simplify the proces by
creating a grid as opposed to a tedious list of rooms this room
connects to.

So I want to know a good way to do a SIMPLE two dimensional array.
Python's lists are a little confusing when it comes to how to do this.
I realized that I could do

list = [ [0] * N ] * N

but I don't know if it would work because I'm a newbie and only
understand arrays if they're in grid-like form. And I haven't ben thru
linear algebra yet, due to my school giving me a few set backs I'm
allready having to take geometry and allgebra II which are meant to be
taken one after another at my school, so any suggestions  or hints in
that direction won't be helpful.

So:
Way to do SIMPLE array, either internally or externally, with Python,
please.




More information about the Python-list mailing list