human
Write me a code to find the vertex diagonally opposite to the vertex M from an N and the other steps required given the following:
Find the vertex diagonally opposite to the vertex M from an N | Function to return the required vertex.
Case 1 :.
Case 2 :.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to find the vertex diagonally opposite to the vertex M from an N and the other steps required.
 def getPosition ( N , M ) :
	if ( M > ( N // 2 ) ) :
		return ( M - ( N // 2 ) )
	return ( M + ( N // 2 ) )
N = 8
M = 5
print ( getPosition ( N , M ) )