作业day4

2018-07-19  本文已影响0人  木偶演员

1.

2^20

2.

在0~~10或0中 筛选出能被3整除或7整除并且都能被21整除

3

x = 1
for x in range(1,101):
    num += x
print(num)


num1 = 0
y = 1
while y<=100:
    num1 += y
    y += 1
print(num1)
num = 0
x = 1
for x in range(1,101):
    if x%3==0:
        num += x
print(num)
        

y = 1
num1= 0
while y <=100:
    if y%3==0:
        num1+=y
print(num1)
x=1
sum =0
while x<=100:
    if x%7!=0:
        sum+=x
    x+=1
print(sum)
上一篇 下一篇

猜你喜欢

热点阅读