human
Give me a code to substring Reverse Pattern and the other steps required given the following:
Substring Reverse Pattern | Function to print the required pattern.
Print the unmodified string.
Reverse the string.
Replace the first and last character by ' * ' then second and second last character and so on until the string has characters remaining.
Driver code"
Solution in Python:
assistant
#Here is code to substring Reverse Pattern and the other steps required.
 def printPattern ( s , n ) :
	print ( ' ' . join ( s ) )
	i , j = 0 , n - 1
	while i < j :
		s [ i ] , s [ j ] = s [ j ] , s [ i ]
		i += 1
		j -= 1
	i , j = 0 , n - 1
	while j - i > 1 :
		s [ i ] , s [ j ] = ' * ' , ' * '
		print ( ' ' . join ( s ) )
		i += 1
		j -= 1
if __name__ == " _ _ main _ _ " :
	s = " geeks "
	n = len ( s )
	printPattern ( list ( s ) , n )