[Tutor] Fwd: Help on finding the 1000th prime

Kent Johnson kent37 at tds.net
Mon Nov 16 21:59:46 CET 2009


Please use reply all to reply to the list


---------- Forwarded message ----------
From: Ray Holt <mrholtsr at sbcglobal.net>
Date: Mon, Nov 16, 2009 at 1:34 PM
Subject: RE: [Tutor] Help on finding the 1000th prime
To: Kent Johnson <kent37 at tds.net>


Basically I can't figure out how to loop through the possible candidates. I
am using version 2.5.6. I creat the varibles :
primeCount =  0
Prime Candidate = 2
While primeCount < 1000
isPrime = True
       primeCanditate = primeCandidate + 2
That's as far as I have gotten. I can't figure out how to loop through the
possible candidates to the 1000th prime.

-----Original Message-----
From: kent3737 at gmail.com [mailto:kent3737 at gmail.com] On Behalf Of Kent
Johnson
Sent: Monday, November 16, 2009 12:33 PM
To: Ray Holt
Cc: tutor at python.org
Subject: Re: [Tutor] Help on finding the 1000th prime

On Mon, Nov 16, 2009 at 10:56 AM, Ray Holt <mrholtsr at sbcglobal.net> wrote:
> I have posted this on other lists, but have just discovered this one.
> Can someone give me help on writing the code necessary to find the
> 1000th. prime number. I know I will have to use a while loop, but I
> can't seem to get the body of the code to function rightly.

What have you tried so far? What don't you understand?

Kent


More information about the Tutor mailing list