On Tue, 02 Dec 2008 21:12:19 +0100 Stefan Behnel <[EMAIL PROTECTED]>
wrote:
> Andreas Waldenburger wrote:
> > [snip]
> > This is of course trivial to do via iteration or listcomps, BUT, I
> > was wondering if there is a function I don't know about that does
> > this nicely?
> 
> I think you're asking about zip():
> 
>       >>> l=[1,2,3]
>       >>> zip(l,l)
>       [(1, 1), (2, 2), (3, 3)]
>       >>> zip(*zip(l,l))
>       [(1, 2, 3), (1, 2, 3)]
> 
So I am. That sure was weird.

Thanks for the quick and somewhat surreal help. Need I say that between
posting this question and reading your reply I set out to implement
this wonder-function?
:)

/W



-- 
My real email address is constructed by swapping the domain with the
recipient (local part).
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to