Write a python program to find the sum of all the primes below hundred.

3)b)Write a python program to find the sum of all the primes below hundred.

 

upto = 100

sum = 0

for num in range(2, upto + 1):

i = 2

for i in range(2, num):
if (int(num % i) == 0):
i = num
break;


if i is not num:
sum += num

print("\nSum of all prime numbers upto 100:", sum)

Comments

Popular posts from this blog

Write a python program to compute cumulative product of a list of numbers (write function cumulative_product).

Write a Python program to compute distance between two points taking input from the user. Formula for Pythagorean theorem for compute distance between two points is: