传入一个数,将小于这个数的所有3和5的倍数相加,并返回和
#解法1 def solution(number): multi_num=0 for num in range(number): if num%3==0 or num%5==0: multi_num+=num return multi_num #解法2 def solution2(number): return sum(i for i in range(number) if i%3==0 or i%5==0) print(solution(10))