1
2# function to return key for any value
3def get_key(val):
4 for key, value in my_dict.items():
5 if val == value:
6 return key
7
8 return "key doesn't exist"
9
10# Driver Code
11
12my_dict ={"java":100, "python":112, "c":11}
13
14print(get_key(100))
15print(get_key(11))
16
1mydict = {'george': 16, 'amber': 19}
2print(list(mydict.keys())[list(mydict.values()).index(16)]) # Prints george