find primes using a for-else construct in Python