The code seems fine but maybe its taking too much time t execute. It is running good in Jupyter notebook. What Changes can be done ?
Here is the code-
num = int(input())
mylist = []
for n in range(num):
[x,y] = list(map(int,input().split()))
mylist.append((x,y))
for (x,y) in mylist:
for num in range(x,y+1):
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num,end = " ")
print()
