基础差的人真的足足想了一天......
dict1 = {"Jim":"y","Bob":"y","Ravioli":"n"} values = [val for val in dict1.values()] values = list(set(values)) values s = {} for value in values: s[value] = [] for key, v in dict1.items(): if v == value: s[value].append(key) s
04-07
3858
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-26
2704
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-14
1057
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-19
9470
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)