as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a program that sorts a list of numbers by smallest to largest using the insertion sort algorithm.
user
def insertion_sort(arr):
    # traverse through 1 to len(arr)
    for i in range(1, len(arr)):
        key = arr[i]
        j = i-1
        # move elements of arr[0..i-1], that are greater than key, to one position ahead of their current position
        while j >=0 and key < arr[j] :
                arr[j+1] = arr[j]
                j -= 1
        arr[j+1] = key
assistant