silly idea - interesting problem

Skip Montanaro skip at
Sat Oct 20 16:24:01 CEST 2001

    >> ... a small script which takes to strings (lets say "test" and
    >> "dust") and mixes them to "tdeusstt".

    Neal> ''.join([ a for x in zip('test', 'dust') for a in x ])

There's always

    ''.join([x+y for x,y in zip('test', 'dust')])


    "".join(reduce(operator.add, zip('test', 'dust'), ())) 

Dunno if they are "easier" or "cleaner" however... ;-)

Skip Montanaro (skip at

More information about the Python-list mailing list