Sunday, December 5, 2010

zip(*a) is its own inverse

>>> zip( *[(1, 2, 3), ('a', 'b', 'c')] )

[(1, 'a'), (2, 'b'), (3, 'c')]

>>> zip( *[(1, 'a'), (2, 'b'), (3, 'c')] )

[(1, 2, 3), ('a', 'b', 'c')]

No comments:

Post a Comment