I am trying to solve the prime generator problem PRIME1 in spoj.com but getting runtime error(NZEC). The problem needs to take a number of test cases and for each test case, it needs to input two numbers in a line for each different test case and then finally print the output as the prime numbers in the range of each number The error is Runtime error time: 0.01 memory: 7736 signal:-1
    # your code goes here
def is_prime(x):
    if x<2:
        return False
    if x==2:
        return True
    for y in range(2,x):
        if x%y==0:
            return False
    return True
t=int(raw_input())
mylist=[]
for i in range(0,t):
    a=raw_input()
    a=a.split(' ')
    mylist.append(int(a[0]))
    mylist.append(int(a[1]))
k=0
while k<len(mylist):
    c=mylist[k]
    k+=1
    d=mylist[k]
    k+=1
    for z in range(c,d+1):
        if is_prime(z):
            print z
    print
 
     
     
    