the algorithm starts by using for loop to run between the indexes and we start from index because we assume the sub-array with index to already be in the sorted orderat the start of the execution of the loopwe have the followingfor index in range( len(unsorted_list))search_index index insert_value unsorted_list[indexat the beginning of the execution of each run of the for loopthe element at unsorted_list[indexis stored in the insert_value variable laterwhen we find the appropriate position in the sorted portion of the listinsert_value will be stored at that index or locationfor index in range( len(unsorted_list))search_index index insert_value unsorted_list[indexwhile search_index and unsorted_list[search_index- insert_value unsorted_list[search_indexunsorted_list[search_index- search_index - unsorted_list[search_indexinsert_value the search_index is used to provide information to the while loop--exactly where to find the next element that needs to be inserted in the sorted portion of the list