Python Program To Find GCD Of Two Numbers

Python program to find GCD of two numbers 


def gcd(m, n):
    fm = []
    for i in range(1, m + 1):
        if (m % 1) == 0:
            fm.append(i)

    fn = []
    for j in range(1, n + 1):
        if (n % j) == 0:
            fn.append(j)

    cf = []
    for f in fm:
        if f in fm:
            cf.append(f)

    return cf[-1]
Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.