how do i merge two sequence

Peter Otten __peter__ at web.de
Wed Apr 18 16:41:00 EDT 2012


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'





More information about the Python-list mailing list