Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

search dictionary for value

mydict = {'george':16,'amber':19}
res = dict((v,k) for k,v in mydict.items())
print(res[16]) # Prints george

print(res.get(16))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #search #dictionary
ADD COMMENT
Topic
Name
9+1 =