Code for finding the 1000th prime
Stefan Behnel
stefan_ml at behnel.de
Tue Nov 17 08:00:35 EST 2009
Robert P. J. Day, 15.11.2009 15:44:
> On Sun, 15 Nov 2009, mrholtsr wrote:
>
>> I am absolutely new to python and barely past beginner in programming.
>> Also I am not a mathematician. Can some one give me pointers for
>> finding the 1000th. prime for a course I am taking over the internet
>> on Introduction to Computer Science and Programming. Thanks, Ray
>
> it's 7919.
Now, all that's left to do is write a prime number generator (a random
number generator will do, too, but writing a good one isn't easy), run it
repeatedly in a loop, and check if the returned number is 7919. Once it
compares equal, you can print the result and you're done.
Stefan
More information about the Python-list
mailing list