NZEC Run time Error Occured

Posted by madan on Stack Overflow See other posts from Stack Overflow or by madan
Published on 2010-05-05T10:07:50Z Indexed on 2010/05/26 5:21 UTC
Read the original article Hit count: 254

Filed under:
|
import math
def gen_caller(a):
        for z in a:
                x,y=z
                if x==1:
                        x=2
                if y>=x and y-x<=100000:
                        for i in range(x,y+1):
                                flag=0
                                for j in range(2,(long(math.sqrt(i))+1)):
                                        if(i%j==0):
                                                flag=1
                                                break
                                if flag==0:
                                        print i
                        print ""

n=(int(raw_input()))
gen_caller([[(long(raw_input())) for j in range(0,2)] for i in range(0,n) if n<=10])

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner