Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

isprime python

# math.isqrt() for Python version 3.8 
def isPrime(n):
    if n < 2: return False
    for i in range(2, isqrt(n) + 1):
        if n % 2 == 0:
            return False
    return True
 
PREVIOUS NEXT
Tagged: #isprime #python
ADD COMMENT
Topic
Name
5+4 =