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