InputThe input begins with the number \$t\$ of test cases in a single line  (\$t \le 10\$). In each of the next \$t\$ lines there are two numbers \$m\$ and \$n\$ (\$1 \le m \le n \le 1000000000\$, \$n-m \le 100000\$) separated by a space.OutputFor every test case print all prime numbers \$p\$ such that \$m \le p \le n\$,  one number per line, test cases separated by an empty line.ExampleInput:21 103 5Output:235735I am trying my best to speed up this code, but I don't know any better way of doing it.T = int(raw_input())x= ' 'for test in xrange(T):    minim,maxim = map(int,raw_input().split())    if minim == 1:        minim += 1    for number in xrange(minim,maxim+1):        if number == 2:            print number        for i in xrange(2,number):            if number % i == 0:                break            elif i == number-1:                print number    print x
Time limit exceeded for SPOJ problem Prime Generator
python;beginner;programming challenge;primes;time limit exceeded