Enumerating primes using Python