"Varsha Purohit" <[EMAIL PROTECTED]> wrote > grid = [[1,1,2,7,6,9],\ > [,9,1,1,1,9,1],\ > [8,1,2,0,0,4],\ > [1,4,1,1,8,5]]
You don't need the '\' characters, the fact that the closing bracket has not been reached means Python will ignore the newline characters. > how can i access to all the elements of the list from column no. 5. > > output should be like [6,9,0,8]... Others have already shown but the easiest way to build a list from another list is via a list comprehension so: col5 = [row[4] for row in grid] HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor