Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #dictionary #python
ADD COMMENT
Topic
Name
5+3 =