Dimitris Kougioumtzis Blog About technology

Basic prime number check

Category Python

Posted on Aug. 23, 2017



Basic prime number check in python


1
2
3
4
5
6
7
8
9
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

About

My name is Dimitris Kougioumtzis and i work as a Web developer at Rapidbounce Company

Elsewhere