newbie question:

Mike C. Fletcher mcfletch at home.com
Sat Jun 23 17:26:28 EDT 2001


x = [[2,3,4],[5,6,7]]

x[0] == [2,3,4]
x[0][1] == 3

x[0][2] = 8  # will replace 4 with 8

x[0].append( 9) will grow the list to be [2,3,8,9]

There really aren't any "multidimensional lists" in base Python (though the
Numeric extensions have multidimensional arrays), just lists that hold
objects, with one of the holdable object types being lists.

HTH,
Mike


-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of krel
Sent: June 23, 2001 16:31
To: python-list at python.org
Subject: newbie question:


Um, this is certainly a stupid sounding question, what is the syntax for
putting data into and retrieving data from a multidimensional list?
I checked the docs, perhaps not well enough?
--
Never trust anything with more limbs than you.
    -krel

--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list