Hello all,

I wrote a python program to find the 1000th prime no. The program isn't
working as it should be.
Please tell what the error is:

## this is to find the 1000th prime number

number = 3
while number < 10000:
    ###initialize stuff
    counter = 1
    ###initializing list to check primarity
    factor = []
    while counter!=(number/2):
        if number % counter == 0:
            factor = factor + [counter]
        counter = counter + 1
        if len(factor) > 1:
            break
        elif counter == 1000:
            print number,
number+=1



The program is printing all the prime nos. from 1009 to 9973. Please respond
fast and give me the correct code with only simple functions as i am a
beginner to python.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to