for in range(gaplen(input_list))temp input_list[ij sort the sub list for this gap while >gap and input_list[ gaptempinput_list[jinput_list[ gapj -gap input_list[jtemp reduce the gap for the next element gap gap// list [ , , , , , , , shellsort(listprint(listwhen the above code is executedit produces the following result[ selection sort in selection sort we start by finding the minimum value in given list and move it to sorted list thenwe repeat the process for each of the remaining elements in the unsorted list the next element entering the sorted list is compared with the existing elements and placed at its correct position soat the end all the elements from the unsorted list are sorted def selection_sort(input_list)for idx in range(len(input_list))min_idx idx for in rangeidx + len(input_list))if input_list[min_idxinput_list[ ]min_idx