fork download
  1. # your code goes here
  2. import operator
  3.  
  4.  
  5. dictionary = {1: 2, "a": "b"}
  6.  
  7. print(operator.itemgetter(1)(dictionary))
  8. print(operator.itemgetter("a")(dictionary))
Success #stdin #stdout 0.01s 6924KB
stdin
Standard input is empty
stdout
2
b