human
Write me a code to largest number that divides x and is co and the other steps required given the following:
Largest number that divides x and is co | Recursive function to return gcd of a and b.
Everything divides 0.
base case.
a is greater.
function to find largest coprime divisor.
divisor code"
How can the above be solved in Python?
assistant
#Here is code to largest number that divides x and is co and the other steps required.
 def gcd ( a , b ) :
	if a == 0 or b == 0 :
		return 0
	if a == b :
		return a
	if a > b :
		return gcd ( a - b , b )
	return gcd ( a , b - a )
def cpFact ( x , y ) :
	while gcd ( x , y ) != 1 :
		x = x / gcd ( x , y )
	return int ( x )
x = 15
y = 3
print ( cpFact ( x , y ) )
x = 14
y = 28
print ( cpFact ( x , y ) )
x = 7
y = 3
print ( cpFact ( x , y ) )