Cody Bable

Generation

generate functionFri, 30 Jun 2023

return list dictionary of the two biggest numbers in a list of dictionaries

def return_biggest_numbers(num_list): num_list.sort(key=lambda x:x["number"], reverse=True) return num_list[:2] return_biggest_numbers([{"number":1},{"number":100},{"number":50}])

Questions about programming?Chat with your personal AI assistant