def selection_sort(lst): i = 0 while i < len(lst): smallest = i j = i + 1 while j < len(lst): if lst[j] < lst[smallest]: smallest = j j += 1 lst[i], lst[smallest] = lst[smallest], lst[i] #swap the elements i += 1 #sort a list L = [99, 9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2] selection_sort(L) print("The sorted list is: ", L)def selection_sort(lst): for i in range(len(lst)): smallest = i for j in range(i + 1, len(lst)): if lst[j] < lst[smallest]: smallest = j lst[i], lst[smallest] = lst[smallest], lst[i] #swap the elements #sort a list L = [99, 9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2] selection_sort(L) print("The sorted list is: ", L)def selection_sort(lst): i = 0 while i < len(lst): smallest = i j = i + 1 while j < len(lst): if lst[j] < lst[smallest]: smallest = j j += 1 lst[i], lst[smallest] = lst[smallest], lst[i] #swap the elements i += 1 #sort a list L = [99, 9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2] selection_sort(L) print("The sorted list is: ", L)