return list dictionary of the two biggest numbers in a list of dictionaries
def two_biggest(d_list): sorted_list = sorted(d_list, key=lambda t:t['number'], reverse=True) return sorted_list[:2] two_biggest([{'number':1}, {'number':3}, {'number':2}, {'number':4}, {'number':7}])