def is_prime(nb: int) -> bool:
    """Check if a number is a prime number or not

    :param nb: the number to check
    :return: True if prime, False otherwise
    """
    # even numbers are not prime
    if nb % 2 == 0 and nb > 2:
        return False

    # checking all numbers up to the square root of the number
    # full explanation:
    # https://stackoverflow.com/questions/18833759/python-prime-number-checker/18833870#18833870
    return all(nb % i for i in range(3, int(nb ** .5) + 1, 2))