So basically I tried my code, it is working but I get an error runtime error (NZEC).
Here is my code:
def is_prime(x):
if x > 1:
n = x // 2
for i in range(2, n + 1):
if x % i == 0:
return False
return True
else:
return False
def solution():
x = int(input())
y = int(input())
for n in range(x, y+1):
if is_prime(n):
print(n)
solution()
created
last reply
- 3
replies
- 1.3k
views
- 4
users