python dict key value 反轉 多個相同的value

例如 a  = {'aa_1': 11, 'aa_2': 11, 'bb_1': 22},我想要的結果是 {11:['aa_1', 'aa_2'], 22:['bb_1']}python defaultdict 這個來實現app a={'aa_1': 11, 'aa_2': 11, 'bb_1': 22} from collections import defaultdict new_a =
相關文章
相關標籤/搜索