human
Count total divisors of A or B in a given range | Utility function to find GCD of two numbers.
Utility function to find LCM of two numbers.
Function to calculate all divisors in given range.
Find LCM of a and b.
Find common divisor by using LCM.
Driver code"
How can the above be solved in Python?

Give me a code to count total divisors of A or B in a given range and the other steps required?
assistant
#Here is code to count total divisors of A or B in a given range and the other steps required.
 def __gcd ( x , y ) :
	if x > y :
		small = y
	else :
		small = x
	for i in range ( 1 , small + 1 ) :
		if ( ( x % i == 0 ) and ( y % i == 0 ) ) :
			gcd = i
	return gcd
def FindLCM ( a , b ) :
	return ( a * b ) / __gcd ( a , b ) ;
def rangeDivisor ( m , n , a , b ) :
	lcm = FindLCM ( a , b )
	a_divisor = int ( n / a - ( m - 1 ) / a )
	b_divisor = int ( n / b - ( m - 1 ) / b )
	common_divisor = int ( n / lcm - ( m - 1 ) / lcm )
	ans = a_divisor + b_divisor - common_divisor
	return ans
m = 3
n = 11
a = 2
b = 3 ;
print ( rangeDivisor ( m , n , a , b ) )
m = 11
n = 1000000
a = 6
b = 35
print ( rangeDivisor ( m , n , a , b ) )