fork(3) download
  1. from math import *
  2.  
  3. a, b = map(int, input().strip().split())
  4. for n in range(max(2,a), b+1):
  5. sqrtN = int(0.1 + sqrt(n))
  6. isPrime = True
  7. for p in range(2, sqrtN+1):
  8. if n%p == 0:
  9. isPrime = False
  10. break
  11. if isPrime:
  12. print(n)
  13.  
Success #stdin #stdout 0.72s 9284KB
stdin
999999999847 999999999947
stdout
999999999847
999999999857
999999999863
999999999877
999999999899
999999999937