human
Restore original String from given Encrypted String by the given operations | Function to decrypt and print the original strings.
If length is exceeded.
Reverse the string.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to restore original String from given Encrypted String by the given operations and the other steps required.
 def decryptString ( s , N ) :
	for i in range ( 0 , len ( s ) , 2 * N ) :
		if ( i + N < len ( s ) ) :
			end = s [ i + N ]
		if ( i + N > len ( s ) ) :
			end = s [ - 1 ]
		if ( i == 0 ) :
			s = s [ i + N - 1 : : - 1 ] + s [ i + N : ]
		else :
			s = s [ : i ] + s [ i + N - 1 : i - 1 : - 1 ] + s [ i + N : ]
	print ( s )
if __name__ == " _ _ main _ _ " :
	s = " ihTs ▁ suohld ▁ ebeas ! y "
	N = 3
	decryptString ( s , N )