method1:
def solu(num):
nums = list(range(1,10))
sum=0
for i in nums:
if i % 3 == 0 or i % 5 == 0:
sum += i
return sum
method2:
def solu(num):
return sum(i for i in (list(range(1,num))) if i%3==0 or i%5==0)
method1:
def solu(num):
nums = list(range(1,10))
sum=0
for i in nums:
if i % 3 == 0 or i % 5 == 0:
sum += i
return sum
method2:
def solu(num):
return sum(i for i in (list(range(1,num))) if i%3==0 or i%5==0)