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)