fork(5) download
  1. from math import *
  2.  
  3. def ddd():
  4. a, b = map(int, input().strip().split())
  5. for n in range(max(2,a), b+1):
  6. sqrtN = int(sqrt(n) + 1)
  7. isPrime = True
  8. try:
  9. for p in range(2, sqrtN+1):
  10. if (n/p).is_integer():
  11. raise Exception()
  12. except Exception:
  13. isPrime = False
  14.  
  15. if isPrime:
  16. print(n)
  17.  
  18. ddd()
Success #stdin #stdout 0.4s 9260KB
stdin
999999999847 999999999947
stdout
999999999847
999999999857
999999999863
999999999877
999999999899
999999999937