"Prime number generator"

def gen(cap=2000000):
    all_primes = []
    def is_prime(i):
        for p in all_primes:
            if p > i ** 0.5:
                return True
            if i % p == 0:
                return False
        return True
    for i in range(2, cap):
        if is_prime(i):
            all_primes.append(i)
            yield i

if __name__ == '__main__':
    print(sum(gen()))

8f0f0fcca6ea3877bf9ba17c2147938542740d91
<mask token>

<mask token>


def gen(cap=2000000):
    all_primes = []

    def is_prime(i):
        for p in all_primes:
            if p > i ** 0.5:
                return True
            if i % p == 0:
                return False
        return True
    for i in range(2, cap):
        if is_prime(i):
            all_primes.append(i)
            yield i


<mask token>

<mask token>


def gen(cap=2000000):
    all_primes = []

    def is_prime(i):
        for p in all_primes:
            if p > i ** 0.5:
                return True
            if i % p == 0:
                return False
        return True
    for i in range(2, cap):
        if is_prime(i):
            all_primes.append(i)
            yield i


if __name__ == '__main__':
    print(sum(gen()))

"Prime number generator"

def gen(cap=2000000):
    all_primes = []
    def is_prime(i):
        for p in all_primes:
            if p > i ** 0.5:
                return True
            if i % p == 0:
                return False
        return True
    for i in range(2, cap):
        if is_prime(i):
            all_primes.append(i)
            yield i

if __name__ == '__main__':
    print(sum(gen()))
