>>> myDict = {'a':'A','b':'B','c':'C'}
>>> myDict
{'a': 'A', 'c': 'C', 'b': 'B'} >>> myDict = {v:k for k, v in myDict.items()}
>>> myDict
{'A': 'a', 'C': 'c', 'B': 'b'}
>>>

方便简单.

05-11 17:43