S.4.1 is_coprime tests failing

Code:

def is_coprime(a, N):
    """Determine if two numbers are coprime.

    Args:
        a (int): First number to check if is coprime with the other.
        N (int): Second number to check if is coprime with the other.

    Returns:
        bool: True if they are coprime numbers, False otherwise.
    """

    return np.gcd(a, N) == 1

Result: Error: is_coprime function is not correct.

This implementation looks right in testing:

is_coprime(3, 12)  # returns False
is_coprime(5, 12)  # returns True

I’ve also implemented is_odd and is_not_one and they seem to be correct as well. I have not included them here because they shouldn’t be relevant.

Hi!
Thanks for your question.
You are completely right, your implementation should work.
We had a conflict in the backend when comparing numpy booleans with python booleans.
I just fixed it. I believe you can test it now and it should work.
Keep enjoying the Codebook!