Answers for "dictionary get key by value python"

0

get a value using a dictionary key in python

print(d.get('key5', 'NO KEY'))
# NO KEY

print(d.get('key5', 100))
# 100
Posted by: Guest on November-10-2021
-3

find key by value python

print(list(d.keys())[list(d.values()).index(990)])
Posted by: Guest on May-04-2020

Code answers related to "dictionary get key by value python"

Python Answers by Framework

Browse Popular Code Answers by Language