#1、计算1000以内3与5的倍数的总和
1 import math 2 3 nums = 0 4 5 for i in range(0,1000): 6 7 if i%3 == 0 or i%5 == 0 : 8 9 if i != 0: 10 11 nums = nums + i 12 13 else: 14 15 continue 16 17 print nums
Better not to ignore the past but learn from it instead. Otherwise, history has a way of repeating itself.