human
Swap Alternate Boundary Pairs | Utility function to print the contents of an array.
Function to update the array.
Initialize the pointers.
While there are elements to swap.
Update the pointers.
Print the updated array.
Driver code"
How can the above be solved in Python?
 Write me a code to swap Alternate Boundary Pairs and the other steps required?
assistant
#Here is code to swap Alternate Boundary Pairs and the other steps required.
 def printArr ( arr , n ) :
	for i in range ( n ) :
		print ( arr [ i ] , end = " ▁ " ) ;
def UpdateArr ( arr , n ) :
	i = 0 ;
	j = n - 1 ;
	while ( i < j ) :
		temp = arr [ i ] ;
		arr [ i ] = arr [ j ] ;
		arr [ j ] = temp ;
		i += 2 ;
		j -= 2 ;
	printArr ( arr , n ) ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 3 , 4 , 5 , 6 ] ;
	n = len ( arr ) ;
	UpdateArr ( arr , n ) ;