human
Kth character from the Nth string obtained by the given operations | Function to return Kth character from recursive string.
If N is 1 then return A.
Iterate a loop and generate the recursive string.
Update current string.
Change A to B and B to A.
Reverse the previous string.
Return the kth character.
Driver Code"
How can the above be solved in Python?

Write me a code to kth character from the Nth string obtained by the given operations and the other steps required?
assistant
#Here is code to kth character from the Nth string obtained by the given operations and the other steps required.
 def findKthChar ( n , k ) :
	prev = " A "
	cur = " "
	if ( n == 1 ) :
		return ' A '
	for i in range ( 2 , n + 1 ) :
		cur = prev + " B "
		temp1 = [ y for y in prev ]
		for i in range ( len ( prev ) ) :
			if ( temp1 [ i ] == ' A ' ) :
				temp1 [ i ] = ' B '
			else :
				temp1 [ i ] = ' A '
		temp1 = temp1 [ : : - 1 ]
		prev = " " . join ( temp1 )
		cur += prev
		prev = cur
	return cur [ k - 1 ]
if __name__ == ' _ _ main _ _ ' :
	N = 4
	K = 3
	print ( findKthChar ( N , K ) )