Ervin Hegedüs wrote:
> On Wed, Apr 18, 2012 at 10:41:00PM +0200, Peter Otten wrote: >> Python Email wrote: >> >> > how do i merge two seqs alernative; >> > >> > ("xyz", "7890") >> > output: x7y8z90 >> >> >>> import itertools >> >>> "".join(a+b for a, b in itertools.izip_longest("xyz", "7890", >> fillvalue="")) >> 'x7y8z90' > > why is this better than simple "".join(("xyz", "7890"))? Have a second look at the desired output. Your suggestion doesn't produce that. -- http://mail.python.org/mailman/listinfo/python-list