#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()
时间: 2024-10-24 12:36:27