def insertion_sort(list):标签:sort,nums,插入排序,list,len,range From: https://www.cnblogs.com/panfei-test-learn/p/17143909.html
N = len(list)
for i in range(1, len(list)):
for j in range(i, 0, -1):
if list[j] < list[j - 1]:
minnum = list[j]
list[j] = list[j - 1]
list[j - 1] = minnum
nums_list = [1, 2, 4, 3, 9, 6, 5]
insertion_sort(nums_list)
print(nums_list)