list of lists
jlg at python.org
Mon Sep 15 16:45:35 CEST 2003
On Mon, 15 Sep 2003 15:59:56 +0200, Tom wrote:
> I have a list that consists of lists. E.g. T=[[1, 2, 3], [4, 5], ]
> Is there a way to address the a specific component in the "inner" list
> E.g. right now I want to get the second value of the first list.
> Unfortunately I have to save it to a variable first and then read it. a =
> print a
Try using T. T is exactly equivalent to 'a', so you can use
the same operations, you don't have to assign to 'a' first.
More information about the Python-list