Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python prime number sum

the_sum = 0
for number in range(20):
    if number > 3:
        for i in range(2,number):
            if (number%i)==0:
                break
            elif i == (number-1):
                the_sum += number
                print(number)
print (the_sum)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #prime #number #sum
ADD COMMENT
Topic
Name
1+2 =