program is not running on your compiler.
it is giving correct output everywhere else.
program:
t=int(input())
p=[]
def findprime(a,b):
pr=[]
for i in range(a,b+1):
if i>1:
for n in range(2,i):
if(i%n)==0:
break
else:
pr.append(i)
p.append(pr)
for i in range(t):
n=input()
m=n.split()
a=int(m[0])
b=int(m[1])
findprime(a,b)
for i in p:
for j in i:
print(j,end=" “)
print(” ")
Prime Generator
Can you please share the code by saving it at the below given link since the indentation is not clear from the above mentioned code .
i have submitted the code on your given link.again it was running correctly on the ide given in your link but still giving error while submitting the code and running it on the builtin ide.
i have switched it to collaborate mode.
No code is visible in your collabed ide , There is a save option next to the ‘run’ button itself in the ide link shared above .
You can save that code there and paste the url of that code here itself .
Since when I’m trying to run your code the output is -
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
3 5 5 5 7 7 7 7 7 9
That maybe because my indentation and yours dont match.
I have looked in your code , there is no issue in it .
The problem is with the question itself .
Since python is a slow language so you would get TLE error in it .
In order to get full marks for this question you can attempt it in any other language such as c/c+ which are comparatively faster than python.
you mean the program which i made is correct.
My course is python if i make it in another language shall i get the full marks for this problem.
This question will soon be removed from your course .