For the tuple, t = ((1, \'a\'),(2, \'b\')) dict(t) returns {1: \'a\', 2: \'b\'}
t = ((1, \'a\'),(2, \'b\'))
dict(t)
{1: \'a\', 2: \'b\'}
Is there a good way to get {\'a\': 1, \'
{\'a\': 1, \'
A slightly simpler method:
>>> t = ((1, 'a'),(2, 'b')) >>> dict(map(reversed, t)) {'a': 1, 'b': 2}