Accessing items in sublists : Index « List « Python Tutorial






numList = [2000, 2003, 2005, 2006]
stringList = ["A", "B", "C"]
mixedList = [1, 2, "three", 4]
subList = ["Python", "Phrasebook", ["Copyright",2006]]
listList = [numList, stringList, mixedList, subList]

if isinstance(subList, list):
    print subList[2][0]








7.12.Index
7.12.1.Indexing
7.12.2.Negative List Indices
7.12.3.Accessing a List
7.12.4.Specific items
7.12.5.use negative indices to access the list from the end rather than from the beginning.
7.12.6.When you use a negative index, Python counts from the right
7.12.7.If a function call returns a sequence, you can index it directly
7.12.8.The index method is used for searching lists to find the index of the first occurrence of a value
7.12.9.Parallel Iteration
7.12.10.Modifying a list
7.12.11.Accessing items in sublists