figure exchanging two values in python pass - comparisons - - - table comparisons for each pass of bubble sort it has the capability to do something most sorting algorithms cannot in particularif during pass there are no exchangesthen we know that the list must be sorted bubble sort can be modified to stop early if it finds that the list has become sorted this means that for lists that require just few passesa bubble sort may have an advantage in that it will recognize the sorted list and stop the code below shows this modificationwhich is often referred to as the short bubble def short_bubble_sort(a_list)exchanges true pass_num len(a_list while pass_num and exchangesexchanges false for in range(pass_num)if a_list[ia_list[ ]exchanges true temp a_list[ia_list[ia_list[ a_list[ temp sorting and searching