Sort python list by function

sort(my_list_of_objects, key=my_number_giving_function)

same for sorted, see the Python Sorting HOWTO

Leave a Comment