flatten a level one list

Paul Rubin http
Wed Jan 11 21:20:15 EST 2006


Robin Becker <robin at SPAMREMOVEjessikat.fsnet.co.uk> writes:
> f([(x0,y0),(x1,y1),....]) --> [x0,y0,x1,y1,....]

>>> import operator
>>> a=[(1,2),(3,4),(5,6)]
>>> reduce(operator.add,a)
(1, 2, 3, 4, 5, 6)



More information about the Python-list mailing list