human
Find the GCD that lies in given range | Return the greatest common divisor of two numbers.
Return the gretest common divisor of a and b which lie in the given range ..
Loop from 1 to sqrt ( GCD ( a , b ) ..
if i divides the GCD ( a , b ) , then find maximum of three numbers res , i and g / i.
Driver Code"
How can the above be solved in Python?

Write me a code to find the GCD that lies in given range and the other steps required?
assistant
#Here is code to find the GCD that lies in given range and the other steps required.
 def gcd ( a , b ) :
	if ( b == 0 ) :
		return a ;
	return gcd ( b , a % b ) ;
def maxDivisorRange ( a , b , l , h ) :
	g = gcd ( a , b ) ;
	res = - 1 ;
	i = l ;
	while ( i * i <= g and i <= h ) :
		if ( g % i == 0 ) :
			res = max ( res , max ( i , g / i ) ) ;
		i += 1 ;
	return int ( res ) ;
if __name__ == " _ _ main _ _ " :
	a = 3 ;
	b = 27 ;
	l = 1 ;
	h = 5 ;
	print ( maxDivisorRange ( a , b , l , h ) ) ;