GCD using Euclid algorithm
One of the nice things with recursion is that you can use it for argument handling.

Where you have a conditional to handle the b &gt; a condition, you could instead use recursion.....

def gcd(a, b):
    """Returns the greatest common divisor of a and b.
    Should be implemented using recursion.

    &gt;&gt;&gt; gcd(34, 19)
    1
    &gt;&gt;&gt; gcd(39, 91)
    13
    &gt;&gt;&gt; gcd(20, 30)
    10
    &gt;&gt;&gt; gcd(40, 40)
    40
    """
    if b &gt; a:
        return gcd(b, a)

    if a % b == 0:
        return b

    return gcd(b, a % b)