Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dictionary1 = {'a': 300, 'b': 400}
- def get_key_by_value(dictionary, value):
- for key, val in dictionary.items():
- if val == value:
- return key
- print(get_key_by_value(dictionary1, 400))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement