Answers for "coprime python"

0

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))
Posted by: Guest on July-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language