Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://projecteuler.net/problem=10
- def isPrime(a):
- return all(a % i for i in range(2, round(a**0.5) + 1)) # returns true if all elements of the iterable returns a positive modulo (nothing divides evenly into a)
- primeSum = 2
- for x in range(3, 2000000, 2):
- if isPrime(x):
- print(x)
- primeSum += x
- print(primeSum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement