On 5/3/05, Anand Kumar <[EMAIL PROTECTED]> wrote:
>
> I am actually trying to mimic a multi dimensional array in C.
> I tried doing things like
Python lists are not arrays in that sense. If you really want an
array, you probably want Numeric or Numarray. Head over to
http://numeric.scipy.org/ to
On 3 May 2005 10:42:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm new to python. I tried doing this
>
> >>> x = [[]] * 3
> >>> print x
> [ [] [] [] ]
> >>> x[0].append( 2 )
> [ [2] [2] [2] ]
>
> I confused with the last line output. I actually expected something
> like
>
> [ [2] [
<[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
| I'm new to python. I tried doing this
|
| >>> x = [[]] * 3
| >>> print x
| [ [] [] [] ]
| >>> x[0].append( 2 )
| [ [2] [2] [2] ]
|
| I confused with the last line output. I actually expected something
| like
|
| [ [2] [] [] ]
|
|
On 3 May 2005 10:42:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm new to python. I tried doing this
>
> >>> x = [[]] * 3
> >>> print x
> [ [] [] [] ]
> >>> x[0].append( 2 )
> [ [2] [2] [2] ]
>
> I confused with the last line output. I actually expected something
> like
>
> [ [2] [
I'm new to python. I tried doing this
>>> x = [[]] * 3
>>> print x
[ [] [] [] ]
>>> x[0].append( 2 )
[ [2] [2] [2] ]
I confused with the last line output. I actually expected something
like
[ [2] [] [] ]
Can anyone give me an explanation. help!!
--
http://mail.python.org/mailman/listinfo/pyth