Re: python list/array question...

2006-07-06 Thread Vic . Kelson
Another way to do it is using a dict with keys that are tuples: >>> arr = {} >>> arr[0,0] = 'a1' >>> arr[0,1] = 'a2' >>> arr[1,0] = 'b1' >>> arr[1,1] = 'b2' >>> arr[2,0] = 'c1' >>> arr[2,1] = 'c2' >>> for j in range(3): ... for i in range(2): ... print arr[j,i], ' ', ... print ...

Re: python list/array question...

2006-07-05 Thread Bruno Desthuilliers
Sybren Stuvel wrote: > Bruno Desthuilliers enlightened us with: > >>Python has lists (which AFAIK really are arrays not linked lists, >>but they are called 'lists'). > > > An array is generally understood as a list of items of the same type, > hence Python lists aren't arrays. A list is general

Re: python list/array question...

2006-07-05 Thread Alex Martelli
Sybren Stuvel <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers enlightened us with: > > Python has lists (which AFAIK really are arrays not linked lists, > > but they are called 'lists'). > > An array is generally understood as a list of items of the same type, > hence Python lists aren't arrays.

Re: python list/array question...

2006-07-05 Thread Diez B. Roggisch
Sybren Stuvel wrote: > Bruno Desthuilliers enlightened us with: >> Python has lists (which AFAIK really are arrays not linked lists, >> but they are called 'lists'). > > An array is generally understood as a list of items of the same type, > hence Python lists aren't arrays. Only in the same sen

Re: python list/array question...

2006-07-05 Thread Bruno Desthuilliers
bruce wrote: > hi... > > i'm trying to deal with multi-dimension lists/arrays Python has lists (which AFAIK really are arrays not linked lists, but they are called 'lists'). FWIW, this is in the fine manual. > i'd like to define a multi-dimension string list, and then manipulate the > list as i

python list/array question...

2006-07-05 Thread bruce
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