#插入排序 

def insertsort(li):
    for index in range(1,len(li)):
        value = li[index]
        i = index -1
        while(i>=0 ):
            if value < li[i]:
                li[i],li[i+1]=value,li[i]
                i = i -1
            else:
                break 
li=[4,6,7,3,3,9,1]

insertsort(li)
print(li)