def is_prime(p): if p <= 1: return False for i in range(2, int(p**0.5) + 1): if p % i == 0: return False return True def prime(): for number in range(500, 999): if is_prime(number): print(number) prime()