def isprime(n):
    """
    tells if n is prime
    input: number
    return boolean
    """
    global primes
    limit = int(math.sqrt(n))
    for prime in primes:
        if prime > limit:
            return True
        if n % prime == 0:
            return False
    raise ValueError, "Not enough primes"

    tells if n is prime
    input: number
    return boolean
    
recipes/Python/576380_Prime_look_up_program/recipe-576380.py