dic = {'a':1, 'b':2, 'c':3, 'd':3, 'e':3, 1:1}
dic['a']
p = 3 search = [] for k in dic: if(dic[k] == p): search.append(k) print(search)
['d', 'c', 'e']
hash_table = {} for k, v in dic.items(): if(v not in hash_table): hash_table[v] = [] hash_table[v].append([k]) print(hash_table)
{1: [[1], ['a']], 2: [['b']], 3: [['d'], ['c'], ['e']]}