Insert item before each element of a list

Agon Hajdari agonh at freenet.de
Mon Oct 8 16:12:09 EDT 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