I am trying to return only the key value '20' but instead my function returns 'None'. I only want it to return None if value is not in my input dictionary.
def find_key(input_dict, value):
for key,val in input_dict.items():
if val == value:
return key
else:
return "None"
find_key({100:'a', 20:'b', 3:'c', 400:'d'}, 'b')