KraftDiner wrote:
> I had a structure that looked like this
> ((0,1), (2, 3), (4, 5), (6,7)
> 
> I changed my code slightly and now I do this:
> odd = (1,3,5,7)
> even = (0,2,4,6)
> all = zip(even, odd)
> 
> however the zip produces:
> [(0, 1), (2, 3), (4, 5), (6, 7)]
> 
> Which is a list of tuples.. I wanted a tuple of tuples...
> 
tuple(zip(even, odd))

and if you fear for memory efficiency

tuple(iterator.izip(even, odd))
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to