Answers for "are sum of multiples of 3 multiple of 3"

1

sum of all multiples of 3 and 5 below 100

c = list(range(1,100))

total = 0

for i in (c):
    if i % 3 == 0 or i % 5 == 0:
      total += i
print (total)
Posted by: Guest on September-11-2021
0

sum of multiples of 3 or 5 python

total = []

for num in range(0,1001):
    if (num % 3 == 0) or (num % 5 == 0):
        total.append(num)
        
print(sum(total))
Posted by: Guest on August-02-2021

Code answers related to "are sum of multiples of 3 multiple of 3"

Browse Popular Code Answers by Language