Python, Numbers, Sorting.
function. numbers = [5, 2, 8, 1, 9] sorted_numbers_desc = sorted(numbers, reverse=True) print(sorted_numbers_desc) # Output: [9, 8, 5, 2, 1] Step 3: Custom Sorting Logic Sorting numbers based on a custom criterion You can use a custom sorting criterion using the key parameter of the sorted