'''
{'a':1,'b':2,'c':1}得到{1:['a','c'],2:['b']}
'''
a={'a':1,'b':2,'c':1}
print(a.keys())#dict_keys(['a', 'b', 'c'])
print(a.items())#dict_items([('a', 1), ('b', 2), ('c', 1)])
b=[[i[1],i[0]] for i in a.items()]
print(b)#[[1, 'a'], [2, 'b'], [1, 'c']]
c={}
for i in b:
if i[0] not in c.keys():
c[i[0]]= [i[1]]
elif i[0] in c.keys():
c[i[0]].append(i[1])
print(c)#{1: ['a', 'c'], 2: ['b']}