import random


def insertionSort(arr):
    for i in range(1, len(arr)):
        while 0 < i and arr[i] < arr[i - 1]:
            arr[i], arr[i - 1] = arr[i - 1], arr[i]
            i -= 1
    return arr


arr = random.sample(range(1, 50), 7)
print(arr)
print(insertionSort(arr))

596772d8714e3d67824688b29d5e0e5245baf549
<mask token>


def insertionSort(arr):
    for i in range(1, len(arr)):
        while 0 < i and arr[i] < arr[i - 1]:
            arr[i], arr[i - 1] = arr[i - 1], arr[i]
            i -= 1
    return arr


<mask token>

<mask token>


def insertionSort(arr):
    for i in range(1, len(arr)):
        while 0 < i and arr[i] < arr[i - 1]:
            arr[i], arr[i - 1] = arr[i - 1], arr[i]
            i -= 1
    return arr


<mask token>
print(arr)
print(insertionSort(arr))

<mask token>


def insertionSort(arr):
    for i in range(1, len(arr)):
        while 0 < i and arr[i] < arr[i - 1]:
            arr[i], arr[i - 1] = arr[i - 1], arr[i]
            i -= 1
    return arr


arr = random.sample(range(1, 50), 7)
print(arr)
print(insertionSort(arr))

import random


def insertionSort(arr):
    for i in range(1, len(arr)):
        while 0 < i and arr[i] < arr[i - 1]:
            arr[i], arr[i - 1] = arr[i - 1], arr[i]
            i -= 1
    return arr


arr = random.sample(range(1, 50), 7)
print(arr)
print(insertionSort(arr))
