选择排序(简单版)(LOW)

zylyehuo / 2023-08-11 / 原文

# _*_coding:utf-8_*_

def select_sort_simple(li):
    li_new = []
    for i in range(len(li)):
        min_val = min(li)
        li_new.append(min_val)
        li.remove(min_val)
    return li_new

li = [3,4,2,1,5,6,8,7,9]
print(li)
select_sort_simple(li)