On 05/13/2013 07:55 PM, Alan Gauld wrote:
On 14/05/13 00:01, Daniel Magruder wrote:

   <SNIP>



That seems OK but it would be simpler with a for loop:

def counting_primes():
    primelist = []
    for prime in range(2,1000):
       if isprime(prime):
          primelist.append(prime)
    return primelist

Actually no, since the OP's looking for the first 1000 primes not for all the primes under 1000.

--
DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to