def insertion_sort(seq):
    for i in range(1,len(seq)):
        value = seq[i]

        # find a suitable slot
        pos = i
        while pos>0 and value<seq[pos-1]:
            seq[pos] = seq[pos-1]
            pos -= 1
        seq[pos] = value
    return seq

print(insertion_sort([2,4,5,7,2,3,9,8]))


e91677ad8febe9cdcd3524f5f3c9a82d868a1daf
<mask token>

def insertion_sort(seq):
    for i in range(1, len(seq)):
        value = seq[i]
        pos = i
        while pos > 0 and value < seq[pos - 1]:
            seq[pos] = seq[pos - 1]
            pos -= 1
        seq[pos] = value
    return seq


<mask token>

def insertion_sort(seq):
    for i in range(1, len(seq)):
        value = seq[i]
        pos = i
        while pos > 0 and value < seq[pos - 1]:
            seq[pos] = seq[pos - 1]
            pos -= 1
        seq[pos] = value
    return seq


print(insertion_sort([2, 4, 5, 7, 2, 3, 9, 8]))

def insertion_sort(seq):
    for i in range(1,len(seq)):
        value = seq[i]

        # find a suitable slot
        pos = i
        while pos>0 and value<seq[pos-1]:
            seq[pos] = seq[pos-1]
            pos -= 1
        seq[pos] = value
    return seq

print(insertion_sort([2,4,5,7,2,3,9,8]))

