Insert item before each element of a list

Agon Hajdari agonh at freenet.de
Mon Oct 8 22:12:09 CEST 2012


On 10/08/2012 09:45 PM, Chris Kaynor wrote:
> [('insertme', i) for i in x]

This is not enough, you have to merge it afterwards.

y = [item for tup in y for item in tup]



More information about the Python-list mailing list