I have a tuple of tuples:
t = ((1, 'one'), (2, 'two'))
I need it in the following format:
((1, 2), ('one', 'two'))
How can I convert it? I can do something like:
digits = tuple ( digit for digit, word in t )
words = tuple ( word for digit, word in t )
rearranged = tuple ( digits, words )
But that seems not elegant, I suppose there's a more straightforward solution.