def swapList(elements, indexBegin, indexEnd):
 (elements[indexBegin], elements[indexEnd]) = (elements[indexEnd], elements[indexBegin])

def swapList ( elements , indexBegin , indexEnd ) : ( elements [ indexBegin ] , elements [ indexEnd ] ) = ( elements [ indexEnd ] , elements [ indexBegin ] )
swap the list elements .