#1、计算1000以内3与5的倍数的总和
import math nums = 0 for i in range(0,1000): if i%3 == 0 or i%5 == 0 : if i != 0: nums = nums + i else: continue print nums
#1、计算1000以内3与5的倍数的总和
import math nums = 0 for i in range(0,1000): if i%3 == 0 or i%5 == 0 : if i != 0: nums = nums + i else: continue print nums