While trying PRIME1 problem i am getting runtime error (NZEC).
def plist(ng,n):
candidates = list(range(n+1))
fin = int(n**0.5)
for i in xrange(2, fin+1):
if candidates[i]:
candidates[2*i::i] = [None] * (n//i - 1)
candidates[:ng] = [None] * (ng)
return [i for i in candidates[2:] if i]
case = int(raw_input())
l=[]
for i in range(case):
temp=raw_input()
temp=temp.split()
l.append((int(temp[0]),int(temp[1])))
for i in l:
prime = plist(i[0],i[1])
for j in prime:
print j
print
the code works fine on my laptop.Cant understand why its giving error (moreover i am new to SPOJ).
my submission id 5101556
it would be great help if somebody helped me out