找出200-400之间素数的快速算法

def isPrime(number):
     divisor = 3
     testLimit = number
     if number % 2 == 0:
         return False
     while testLimit > divisor:
         if number % divisor == 0:
             return False
         testLimit = number / divisor
         divisor += 2
     return True
 if __name__ == "__main__":
     for i in range(200, 400):
         if isPrime(i):
             print i

你可能感兴趣的:(400)