Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

isprime function in python

def isPrime(n):
    if n > 1:  
        for i in range(2,n):  
            if (n % i) == 0:  
                return False
        return True
    else:
        return False
 
PREVIOUS NEXT
Tagged: #isprime #function #python
ADD COMMENT
Topic
Name
9+2 =