d = {'key1': 'aaa', 'key2': 'aaa', 'key3': 'bbb'}
keys = [k for k, v in d.items() if v == 'aaa']
print(keys)
# ['key1', 'key2']
keys = [k for k, v in d.items() if v == 'bbb']
print(keys)
# ['key3']
keys = [k for k, v in d.items() if v == 'xxx']
print(keys)
# []
k = {1:10,2:20,3:30,4:40}
#idea : print([5,6,7,8][[12,15,47,45].index(15)])
b = list(k.keys())[list(k.values()).index(20)] #find index of 20 => return 2