Problem 10

Problem: 

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

Find the sum of all the primes below two million.


My Solution:

n=2000000

def isprime(n):
    for j in range(2,int(n**0.5)+1):
        if n % j == 0:
            return False
    return True

def primes(n):
    yield 2
    m = 3
    while m < n:
        if isprime(m):
            yield m
        m +=2

print sum(primes(n))