Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sum of multiples of 5 from 1 to 100

total = 0

for i in range(1, 100):
    if i % 3 == 0:
        total = total + i
print(total)

total1 = 0
for i in range(1, 100):
    if i % 5 == 0:
        total1 = total1 + i
print(total1)
Source by www.linkedin.com #
 
PREVIOUS NEXT
Tagged: #sum #multiples
ADD COMMENT
Topic
Name
6+3 =