Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

access myultiple dict values with list pythojn

from operator import itemgetter

my_dict = {x: x**2 for x in range(10)}

itemgetter(1, 3, 2, 5)(my_dict)
#>>> (1, 9, 4, 25)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #myultiple #dict #values #list #pythojn
ADD COMMENT
Topic
Name
5+1 =