python 元组中元组转为字典

#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