--- On Wed, 1/7/09, Artie Ziff wrote:
From: Artie Ziff
Subject: [Tutor] simple array access
To: Tutor@python.org
Date: Wednesday, January 7, 2009, 9:12 PM
Hello,
I used python list comprehension to create a grid (list of lists) of
Objects (instances of MyItem class). Can anyone make
> My attempt at array access (like this: array[1,2] ) does not work. What am
> I overlooking? Thanks in advance! :)
> :
> pprint (grid.data[1,2])
is that really your name?!? you're famous! ;-) welcome to python!
i'd try...
pprint(grid.data[0][1])
... as many languages start counting at 0
On Wed, 2009-01-07 at 18:12 -0800, Artie Ziff wrote:
> Hello,
>
> I used python list comprehension to create a grid (list of lists) of
> Objects (instances of MyItem class). Can anyone make recommendations to
> achieve a simple access to the elements. My attempt at array access
> (like this: array
Hello,
I used python list comprehension to create a grid (list of lists) of
Objects (instances of MyItem class). Can anyone make recommendations to
achieve a simple access to the elements. My attempt at array access
(like this: array[1,2] ) does not work. What am I overlooking? Thanks in
advance!