SyntaxFix
Write A Post
Hire A Developer
Questions
Even more concise if you are on python 2.7:
>>> t = ((1,'a'),(2,'b')) >>> {y:x for x,y in t} {'a':1, 'b':2}