how to check if 2 numbers are coprime python code example
Example: coprime python
def gcd(p,q):
# Create the gcd of two positive integers.
while q != 0:
p, q = q, p%q
return p
def is_coprime(x, y):
return gcd(x, y) == 1
print(is_coprime(17, 13))
print(is_coprime(17, 21))
print(is_coprime(15, 21))
print(is_coprime(25, 45))