Define a 2d Array?

Jillian Calderon jillian.calderon at gmail.com
Sun Oct 12 04:19:28 CEST 2008


Hi.

How do I define a 2d list?

For instance, to define a 4 by 5 list, I wanted to do this:
n=4
m=5
world = [n][m]
However, it gives me an invalid syntax error saying the index is out
of range.
I know this is a real newbie question, but if you could help me out,
I'd really appreciate it!

Thanks,
Jill



More information about the Python-list mailing list