You can download this code by clicking the button below.
This code is now available for download.
Sorts the input list first by the remainder of the elements divided by 10, and then by the elements themselves if the remainders are the same.
Technology Stack : List comprehension, lambda expression, sorting
Code Type : Function
Code Difficulty : Intermediate
def acesort(array):
return sorted(array, key=lambda x: (x % 10, x))