defining multi dimensional array

B

bruce

hi...

basic question..

how do i define a multi dimensional array

a[10][10]

is there a kind of a = array(10,10)

thanks

-bruce
 
E

Erik Max Francis

bruce said:
basic question..

how do i define a multi dimensional array

a[10][10]

is there a kind of a = array(10,10)

It's just a list of lists.
 
T

tac-tics

bruce said:
hi...

basic question..

how do i define a multi dimensional array

a[10][10]

I find that list comprehensions are useful for this.

[ [None for x in xrange(10)] for y in xrange(10)]

You could easily write a wrapper for it to clean the syntax a bit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top