def insert_sort(li):
for i in range(1, len(li)):
temp = li[i]
j = i - 1
while j >= 0 and temp < li[j]:
li[j + 1] = li[j]
j -= 1
li[j + 1] = temp
print(li)
li = [3, 4, 2, 1, 5, 7, 9, 8, 6]
insert_sort(li)