human
Write me a code to print array after it is right rotated K times and the other steps required given the following:
Print array after it is right rotated K times | Function to rightRotate array.
If rotation is greater than size of array.
Printing rightmost kth elements.
Prints array after ' k ' elements.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to print array after it is right rotated K times and the other steps required.
 def RightRotate ( a , n , k ) :
	k = k % n ;
	for i in range ( 0 , n ) :
		if ( i < k ) :
			print ( a [ n + i - k ] , end = " ▁ " ) ;
		else :
			print ( a [ i - k ] , end = " ▁ " ) ;
	print ( " " ) ;
Array = [ 1 , 2 , 3 , 4 , 5 ] ;
N = len ( Array ) ;
K = 2 ;
RightRotate ( Array , N , K ) ;