human
Minimum integer that can be obtained by swapping adjacent digits of different parity | Function to return the minimum number.
Store the elements which are divisible by two in stack1.
Store the elements which are not divisible by two in stack2 ..
Concatenate the answer with smaller value of the topmost elements of both the stacks and then pop that element.
Concatenate the answer with remaining values of stack1 ..
Concatenate the answer with remaining values of stack2 ..
Driver code.
Function calling"
How can the above be solved in Python?

=====
What is a code to minimum integer that can be obtained by swapping adjacent digits of different parity and the other steps required?
assistant
#Here is code to minimum integer that can be obtained by swapping adjacent digits of different parity and the other steps required.
 def minimumNo ( n ) :
	ans = 0
	stack1 = [ ]
	stack2 = [ ]
	while ( n != 0 ) :
		r = n % 10
		if ( r % 2 == 0 ) :
			stack1 . append ( r )
		else :
			stack2 . append ( r )
		n = n // 10
	while ( len ( stack1 ) > 0 and len ( stack2 ) > 0 ) :
		if ( stack1 [ - 1 ] < stack2 [ - 1 ] ) :
			ans = ans * 10 + stack1 [ - 1 ]
			del stack1 [ - 1 ]
		else :
			ans = ans * 10 + stack2 [ - 1 ]
			del stack2 [ - 1 ]
	while ( len ( stack1 ) > 0 ) :
		ans = ans * 10 + stack1 [ - 1 ]
		del stack1 [ - 1 ]
	while ( len ( stack2 ) > 0 ) :
		ans = ans * 10 + stack2 [ - 1 ]
		del stack2 [ - 1 ]
	return ans
n1 = 64432
print ( minimumNo ( n1 ) )
n2 = 3137
print ( minimumNo ( n2 ) )