i used it in correct format
like the below code, i tried to submit it but getting the same TLE error.
def is_prime(k):
b=1
for j in range(2,int(k/2+1)):
if k%j==0:
b=0
break
b=1
if b==1:
return True
else:
return False
t=int(input('enter the nbr of cases '))
r=[]
if t<=150:
for i in range(0,t):
while 1:
l,u=map(int, input().split( ))
if 2<=l<u<=2147483647 and u-l<=1000000:
break
else:
print('enter the nbr again')
for k in range(l,u+1):
if is_prime(k):
s=str(k)
r.append(s)
for p in r:
print(p)