例如 a = {'aa_1': 11, 'aa_2': 11, 'bb_1': 22},我想要的结果是 {11:['aa_1', 'aa_2'], 22:['bb_1']}
defaultdict 这个来实现
a={'aa_1': 11, 'aa_2': 11, 'bb_1': 22}
from collections import defaultdict
new_a = defaultdict(list)
for key, value in a.items():
new_a[value].append(key)