python list/array question...

bruce bedouglas at earthlink.net
Wed Jul 5 09:24:36 EDT 2006


hi...

i'm trying to deal with multi-dimension lists/arrays

i'd like to define a multi-dimension string list, and then manipulate the
list as i need... primarily to add lists/information to the 'list/array' and
to compare the existing list information to new lists

i'm not sure if i need to import modules, or if the base python install i
have is sufficient. an example, or pointer to examples would be good...

i'd like

 define a[][]

 #basically, i'd like a 3x3 array, where each element
 #has one of the a,b,c items..
 # |a1, b1, c1|
 # |a2, b2, c2|
 # |a3, b3, c3|

 a[1][1] = ['a1','b1','c1']
 a[1][2] = ['a2','b2','c2']
 a[1][3] = ['a3','b3','c3']

 b = ['f','g','h']
 v = ['f1','g1','h1']

 if a[1][2] == b
   print 'good!'

 a[1][4] = b

 x = 4
 g = ['p1','l1','g1']

 for i in range[g]
  a[x][i] = g[i]


these are the kinds of list/array functions i'd like to be able to
accomplish

pointers/code samples/pointers to code would be helpful...

and yeah. i've been looking via google...

thanks

-bruce






More information about the Python-list mailing list