How to convert list of tuples into a single list of unique values ?
Paul Rubin
phr-n2002a at nightsong.com
Thu Jan 10 09:49:28 EST 2002
pekka niiranen <krissepu at vip.fi> writes:
> I have a list of equal size tuples, but a tuple may contain empty values:
>
> t = [ ( a,b,c), (d, ,f) (b,a,j) ]
>
> How can I convert it into a single list of unique values:
>
> l = [a,b,c,d,f,j]
>
> No lambdas, please
I don't think (d, ,f) is syntactically valid. Other than that,
is something wrong with
import operator
l = operator.add(*t)
More information about the Python-list
mailing list