def paixu(lists):
# 插入排序
count = len(lists)
for i in range(1, count):
key = lists[i]
j = i - 1
while j >= 0:
if lists[j] > key:
lists[j + 1] = lists[j]
lists[j] = key
j -= 1
return lists
lis = [2,9,5,4,8,1,6]
paixu(lis)
# [1, 2, 4, 5, 6, 8, 9]
难得一批。。