Re: Computing the 1000th prime

2009-11-12 Thread Dave Angel
Ray Holt wrote: I have an assigment to find the 1000th. prime using python. What's wrong with the following code: PrimeCount = 0 PrimeCandidate = 1 while PrimeCount < 2000: IsPrime = True PrimeCandidate = PrimeCandidate + 2 for x in range(2, PrimeCandidate): if PrimeCandidate

Re: Computing the 1000th prime

2009-11-12 Thread Benjamin Kaplan
On Thursday, November 12, 2009, Benjamin Kaplan wrote: > On Thursday, November 12, 2009, Ray Holt wrote: >> >> >> >> >> >> I have an assigment >> to find the 1000th. prime using python. What's wrong with the following >> code: >> PrimeCount = >> 0 >> PrimeCandidate = 1 >> while PrimeCount < 2000:

Re: Computing the 1000th prime

2009-11-12 Thread Benjamin Kaplan
On Thursday, November 12, 2009, Ray Holt wrote: > > > > > > I have an assigment > to find the 1000th. prime using python. What's wrong with the following > code: > PrimeCount = > 0 > PrimeCandidate = 1 > while PrimeCount < 2000: > > IsPrime = True >     PrimeCandidate = PrimeCandidate + > 2 >    

Re: Computing the 1000th prime

2009-11-12 Thread MRAB
Ray Holt wrote: I have an assigment to find the 1000th. prime using python. What's wrong with the following code: PrimeCount = 0 PrimeCandidate = 1 while PrimeCount < 2000: IsPrime = True PrimeCandidate = PrimeCandidate + 2 for x in range(2, PrimeCandidate): if PrimeCandidate