Gopinath V, ASDC Chennai wrote:
That'll teach me to read the whole question. In the above list comprehension, stuff is the defined list. row is a variable created by the list comprehension. Basically, this is another way of saying: for row in stuff: print row[0] or for i in range(len(stuff)): print stuff[i][0] In this case, row's type is whatever type that element in stuff is (which is a list). Ie: >>> stuff = [[0,'sdfsd','wrtew'], [1, 'rht','erterg']] >>> print [(row[0], type(row), type(row[0])) for row in stuff] [(0, <type 'list'>, <type 'int'>), (1, <type 'list'>, <type 'int'>)] -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it. |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor