14 3和5的倍数之和

1 sum = 0
2 l = []
3 for i in range(1,1000):
4     if i%3 == 0 and i%5 == 0:
5         sum += 1
6         l.append(i)
7 print(l)
8 print(sum)

 

posted @ 2020-04-07 07:32  不着魔,不成佛  阅读(154)  评论(0编辑  收藏  举报