On Dec 2, 2:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? >
One list comprehension is enough: >>> c=[(5,3), (6,8)] >>> [x for t in c for x in t] [5, 3, 6, 8] HTH -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list