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

博客地址:https://www.cnblogs.com/zylyehuo/

# _*_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)
print(select_sort_simple(li))

posted @ 2023-08-12 17:04  zylyehuo  阅读(4)  评论(0编辑  收藏  举报