return list dictionary of the two biggest numbers in a list of dictionaries
def sort_two_biggest_numbers(lst): sorted_list = sorted(lst, key=lambda x: x['value']) return sorted_list[-2:] lst = [{'value': 1}, {'value': 2}, {'value': 3}] print(sort_two_biggest_numbers(lst))