Reverse the string
if ( i == 0 ) : NEW_LINE INDENT s = s [ i + N - 1 : : - 1 ] + s [ i + N : ] NEW_LINE DEDENT else : NEW_LINE INDENT s = s [ : i ] + s [ i + N - 1 : i - 1 : - 1 ] + s [ i + N : ] NEW_LINE DEDENT print ( s ) NEW_LINE