For a list x of lists, when I want to get the first member of all the lists in x, I type x[:][0]. But it gives me the first list in x. Can someone explain why this is so?
Here is an example.
x=[[1,2],[3,4]]
print x[0][:]
print x[:][0]
I get same answer for both x[:][0] and x[0][:] I get the same answer, namely [1,2].
I am using Python 2.6.6.
Thanks in advance.
[x[0] for x in nested]?