Timelimt error again

can this code be reduced to less time complexity
t=int(input())
for x in range(1,t+1):
n1, n2 = map(int,input().split())

for y in range(n1,n2+1):  
    if y==1:
        continue
    i=2
    while i*i<=y:
        if y%i==0:
            break;
        i=i+1
        
    else:
        print(y,end=" ")
print()

Your code is already optimised .
But still you wont be able to pass the second test case since it was made for languages such as c/c++ which are much faster than python.
So you wont be able to submit this code in python.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.