Euclidean GCD function returns type None instead of int : <p>I'm getting back into mathematics, algorithms, and data structures. Today, I spent time studying up on the Euclidean algorithm and greatest common divisors.  </p>

<p>Below, I implemented a function to demonstrate what I learned:  </p>

<pre><code>from math import floor

def euclidian(a: int, b: int):
    # a = b * q + r
    _q: int = int(floor(a / b))
    print(f"Quotient: {_q}")
    r: int = a % b
    print(f"Remainder: {r}")
    a = b
    print(f"A = B({a})")
    b = r
    print(f"B = R({b})")

    if a != 0 and b != 0:
        euclidian(a, b)

    # a = 0; gcd(0, b) = b
    elif a == 0:
        print(f"Returning value a({b}) | type: {type(b)}")
        return b

    # b = 0; gcd(a, 0) = a 
    elif b == 0:
        print(f"Returning value a({a}) | type: {type(a)}")
        return a

a: int = 270
b: int = 192
gcd: int = euclidian(a, b)
print(f"GCD type: {type(gcd)}")
print(f"GCD({a}, {b}) = {gcd}")
</code></pre>

<p>This recursive function goes through a couple iterations, and ends up returning these results: </p>

<pre><code>Quotient: 6
Remainder: 0
A = B(6)
B = R(0)
Returning value a(6) | type: &lt;class 'int'&gt;

GCD type: &lt;class 'NoneType'&gt;
GCD(270, 192) = None
</code></pre>

<p>It's getting later in the day, so perhaps I just need a cup of tea to wake myself up. But I can't seem to wrap my head around why the variable <code>gcd</code> is <code>None</code> and not the integer value of <code>a</code>. What am I missing?   </p>

<p>Thanks.</p>
