# Write a function called ascending_sort that # takes a list of positive integers, # sort the integers from small to large, # and then return the sorted list. # # Do not use any built-in functions # except len(), remove(), and append() # def ascending_sort(lst): number_item = len(lst) result = [] temp_lst = lst running_count = 0 while len(result) < number_item: min_value = lst[0] for i in range (0, len(temp_lst)): #print(str(temp_lst[i]) + " : " + str(min_value)) if temp_lst[i] < min_value: min_value = temp_lst[i] result.append(min_value) temp_lst.remove(min_value) running_count += 1 print("running " + str(running_count) + " -->") print(" result = " + str(result) + " : temp_lst = " + str(temp_lst)) return result print(ascending_sort([6,3,9,5,2,8,4,1,7]))