# Problem 10
## Summation of primes

## To do list
* Import sympy.
* Create a variable to store the sum.
* Run a loop upto 2 million.
* Print the sum.

## Importing sympy
Importing our module sympy to check whether any number is prime or not.


```python
import sympy as smp
```

## Creating variable
Creating a variable to store the result of all summations. We already added 2 in it which is the only even prime number.


```python
summation = 2
```

## Looping till 2 million
Running a loop till 2 million with a jump of 2 to ignore even numbers.


```python
for i in range(3, 2000000, 2):
    if smp.isprime(i) == True:
        summation += i
```

## Printing result
Printing the final sum of summation after adding all primes upto 2 million.


```python
print("The sum of all the prime numbers upto 2 million is:", summation)
```

6a752950212931955e385d6da0b5ed95601999c7
ipynb
Jupyter Notebook
Project10.ipynb
akashgh0sh2807/Project-Euler
de0542a59c56918408b263885dcb6d84d25339d1
Apache-2.0
Project10.ipynb
akashgh0sh2807/Project-Euler
de0542a59c56918408b263885dcb6d84d25339d1
Apache-2.0
Project10.ipynb
akashgh0sh2807/Project-Euler
de0542a59c56918408b263885dcb6d84d25339d1
Apache-2.0
Qwen/Qwen-72B
1. YES
2. YES