python tuple to dict October 20, 2022 by Tarik Try: >>> t = ((1, 'a'),(2, 'b')) >>> dict((y, x) for x, y in t) {'a': 1, 'b': 2}