互换键值位置
prefs = {'Lady in the water':{'Lisa Rose':2.5, 'Gene Seymour':3.0}, 'Lady in the moon':{'Lisa Rose':3.5, 'Gene Seymour':2.0}, 'spring festival':{'Lisa Rose':1.5, 'Gene Seymour':1.0}, 'happy everyday':{'Lisa Rose':3.5, 'Gene Seymour':4.0}, } def transformPrefs(prefs): result = {} for person in pre...