Can I return a list of ALL min tuples, using Python's Min function?
问题 Say I have a list of tuples, like the following: listo = [('a','1'),('b','0'),('c','2'),('d','0')] If I want the lowest tuple, based on the second index of each tuple, I can customize the min function with a lambda function, like this: min(listo, key=lambda x: x[1]) As it stands, this code would return: In [31]: min(listo, key=lambda x: x[1]) Out[31]: ('b', '0') But this only gives me one tuple, and only the first one it encounters at that. What if I wanted ALL the min tuples? So it returns