matrixas nested lists [ ]code can span lines if bracketed [ ] [[ ][ ][ ]herewe've coded list that contains three other lists the effect is to represent matrix of numbers such structure can be accessed in variety of waysm[ [ get row [ ][ get row then get item within the row the first operation here fetches the entire second rowand the second grabs the third item within that row (it runs left to rightlike the earlier string strip and splitstringing together index operations takes us deeper and deeper into our nested-object structure comprehensions in addition to sequence operations and list methodspython includes more advanced operation known as list comprehension expressionwhich turns out to be powerful way to process structures like our matrix supposefor instancethat we need to extract the second column of our sample matrix it' easy to grab rows by simple indexing because the matrix is stored by rowsbut it' almost as easy to get column with list comprehensioncol [row[ for row in mcol [ collect the items in column [[ ][ ][ ]the matrix is unchanged list comprehensions derive from set notationthey are way to build new list by running an expression on each item in sequenceone at timefrom left to right list comprehensions are coded in square brackets (to tip you off to the fact that they make listand are composed of an expression and looping construct that share variable name (rowherethe preceding list comprehension means basically what it says"give me row[ for each row in matrix min new list the result is new list containing column of the matrix list comprehensions can be more complex in practice this matrix structure works for small-scale tasksbut for more serious number crunching you will probably want to use one of the numeric extensions to pythonsuch as the open source numpy and scipy systems such tools can store and process large matrixes much more efficiently than our nested list structure numpy has been said to turn python into the equivalent of free and more powerful version of the matlab systemand organizations such as nasalos alamosjpland many others use this tool for scientific and financial tasks search the web for more details lists