示例#1
0
def pe010():
    """Find the sum of all primes below two million"""
    from tools import primeGenerator

    return sum(itertools.takewhile(lambda x: x < 2000000,
                                   primeGenerator()))
示例#2
0
def pe007():
    """Find the 10001st prime number"""
    from tools import primeGenerator, nthItem
    
    return nthItem(primeGenerator(), 10001)