human
Minimum number of moves required to reach the destination by the king in a chess board | function to Find the minimum number of moves required to reach the destination by the king in a chess board.
minimum number of steps.
while the king is not in the same row or column as the destination.
Go up.
Go down.
Go left.
Go right.
Driver code"
How can the above be solved in Python?
 ... Write me a code to minimum number of moves required to reach the destination by the king in a chess board and the other steps required?
assistant
#Here is code to minimum number of moves required to reach the destination by the king in a chess board and the other steps required.
 def MinSteps ( SourceX , SourceY , DestX , DestY ) :
	print ( max ( abs ( SourceX - DestX ) , abs ( SourceY - DestY ) ) )
	while ( ( SourceX != DestX ) or ( SourceY != DestY ) ) :
		if ( SourceX < DestX ) :
			print ( ' U ' , end = " " )
			SourceX += 1
		if ( SourceX > DestX ) :
			print ( ' D ' , end = " " )
			SourceX -= 1
		if ( SourceY > DestY ) :
			print ( ' L ' )
			SourceY -= 1
		if ( SourceY < DestY ) :
			print ( ' R ' , end = " " )
			SourceY += 1
if __name__ == ' _ _ main _ _ ' :
	sourceX = 4
	sourceY = 4
	destinationX = 7
	destinationY = 0
	MinSteps ( sourceX , sourceY , destinationX , destinationY )