SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible
in order to be comprehensible and easily extensible. SymPy is written entirely in Python.
import sympy
a,b = 500,600
print(a,b)
numbers = range(a,b)
prime_numbers = filter(sympy.isprime, numbers)
print("Prime numbers({}-{}:".format(a,b))
for prime_number in prime_numbers:
print(prime_number,end=",")
print()
500 600
Prime numbers(500-600:
503,509,521,523,541,547,557,563,569,571,577,587,593,599,
Process finished with exit code 0