Answers for "find key of a value in dictionary python"

0

find value in dictionary python

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
Posted by: Guest on September-10-2021

Code answers related to "find key of a value in dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language