summaryrefslogtreecommitdiffstats
path: root/docs/source/_static/QuickStart/simple_submission_1/euclid.py
blob: f72707a85f995108b9ce9ba800f16bdae0eb489a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# the newest!
# assessment 1

def gcd(m,n) -> int:
    """Calculates the greatest common denominator between two numbers.

    Args:
        x (int): Number One
        y (int): Number Two

    Returns:
        int: The GCD of the two numbers
    """
    if m< n:
        (m,n) = (n,m)
    if(m%n) == 0:
        return n
    else:
        return (gcd(n, m % n)) # recursion taking place

# gcd
print(gcd(8,12))