what does int means for python ?
castironpi at gmail.com
castironpi at gmail.com
Sun May 11 17:52:30 EDT 2008
On May 11, 5:05 am, alefajnie <devp... at gmail.com> wrote:
> > try arr[2][3] instead.
>
> > basically your version is trying to index an array with a tuple argument (2,3).
>
> > --irmen
>
> oh, you're right.
>
> btw, is any simple way to create multi-dimension array ?
> any built-in function ?
it is not clear that two-dim arrays are faster than hashes in all
implementations of Python, or in every general language, or if they're
the right symbol for your program.
>>> a= { }
>>> a[ 0, 1 ]= True
>>> a[ 4, 0 ]= True
>>> a[ 0, 1 ]
True
however, this one:
>>> a[ 2, 1 ]
results in a KeyError. do you want a particular thing, or are you on
the clock?
if you want to define 'blanks', that takes time too. is it initally
empty?
More information about the Python-list
mailing list