best way to do this

TP Tribulations at Paralleles.invalid
Tue Dec 2 09:09:53 EST 2008


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?

Thanks

Julien
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z
(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)



More information about the Python-list mailing list