def prime(): arr = [] for i in range(500, 600): cnt = 0 for j in range(2, int(i ** 0.5) + 1): if i % j == 0: pass else: cnt += 1 if cnt == int(i ** 0.5) - 1: arr.append(i) return arr print(prime())