#create a tuple tuplex = ((2, "w"),(3, "r")) print(dict((y, x) for x, y in tuplex)) 转载于:https://www.cnblogs.com/sea-stream/p/9945018.html