# _*_coding:utf-8_*_
def select_sort(li):
for i in range(len(li)-1): # i是第几趟
min_loc = i
for j in range(i+1, len(li)):
if li[j] < li[min_loc]:
min_loc = j
li[i], li[min_loc] = li[min_loc], li[i]
print(li)
li = [3,4,2,1,5,6,8,7,9]
print(li)
select_sort(li)
标签:sort,loc,min,len,li,选择,range,LOW,排序
From: https://www.cnblogs.com/zylyehuo/p/17623886.html