On Thu, 2 Apr 2009, Neal Becker wrote: > How do I interleave 2 sequences into a single sequence? > > How do I interleave N sequences into a single sequence?
Here's one way: def interleave(*args): for n in range(min(len(i) for i in args)) : for i in args: yield i[n] HTH, John -- http://mail.python.org/mailman/listinfo/python-list