import math def CheckPrime(n): if n < 2: return False for i in xrange(2, int(math.sqrt(n)) + 1): if n % i == 0: return False return True