human
Kth element in permutation of first N natural numbers having all even numbers placed before odd numbers in increasing order | Function to find the K - th element in the required permutation.
Stores the required permutation.
Insert all the even numbers less than or equal to N.
Now , insert all odd numbers less than or equal to N.
Print the Kth element.
Driver Code.
functions call"
How can the above be solved in Python?

Give me a code to kth element in permutation of first N natural numbers having all even numbers placed before odd numbers in increasing order and the other steps required?
assistant
#Here is code to kth element in permutation of first N natural numbers having all even numbers placed before odd numbers in increasing order and the other steps required.
 def findKthElement ( N , K ) :
	v = [ ]
	for i in range ( 1 , N + 1 ) :
		if ( i % 2 == 0 ) :
			v . append ( i )
	for i in range ( 1 , N + 1 ) :
		if ( i % 2 != 0 ) :
			v . append ( i )
	print ( v [ K - 1 ] )
if __name__ == " _ _ main _ _ " :
	N = 10
	K = 3
	findKthElement ( N , K )