Basic prime number check

Python -- Posted on Aug. 23, 2017

Basic prime number check in python

              
                def is_prime(n):
    '''
    Check prime number
    '''
    if n == 2 or n == 3:
        return True
    if n % 2 == 0 or n % 3:
        return False
    return True
                  
   
            

Related Posts