results = [({'age': 1}, 30),
({'weight': 80}, 5),
({'label': 'abc'}, 7)]
As shown above, I have a list of tuples. Is there any elegant way to get the tuple whose has the smallest 2nd item?
More generally, if I need to get the tuple who has the smallest eval(2nd item)
? eval
is a transformation function.