def problem10(): n = 2000000 primes_below_n = itertools.takewhile(lambda p: p < n, gen_primes()) return sum(primes_below_n)
def problem7(): gen = enumerate(gen_primes()) gen = itertools.dropwhile(lambda e: e[0] < 10001, gen) gen = itertools.imap(lambda e: e[1], gen) return gen.next()