#coding:utf8 def sort(start_list): num = len(start_list) for i in range(num-1): min = i for j in range((i+1),num): if start_list[j] < start_list[min]: min = j (start_list[i],start_list[min]) = (start_list[min],start_list[i]) def main(): start_list = [2,3,6,5,6,9,8,10,4,8,12,20,200,12] sort(start_list) print start_list if __name__ == '__main__': main()
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8402.html