human
Find the Missing Number in a sorted array | A binary search based program to find the only missing number in a sorted in a sorted array of distinct elements within limited range.
Driver Code"
How can the above be solved in Python?

Give me a code to find the Missing Number in a sorted array and the other steps required?
assistant
#Here is code to find the Missing Number in a sorted array and the other steps required.
 def search ( ar , size ) :
	a = 0
	b = size - 1
	mid = 0
	while b > a + 1 :
		mid = ( a + b ) // 2
		if ( ar [ a ] - a ) != ( ar [ mid ] - mid ) :
			b = mid
		elif ( ar [ b ] - b ) != ( ar [ mid ] - mid ) :
			a = mid
	return ar [ a ] + 1
a = [ 1 , 2 , 3 , 4 , 5 , 6 , 8 ]
n = len ( a )
print ( " Missing ▁ number : " , search ( a , n ) )