# python100内3整除while_python-循环语句-习题及答案-for-while

for 变量 in range(起始，终止，步长):

while 终止条件(bool):

break continue

1. 盈盈为了考验令狐冲夺冠的决心，要他说一百遍“我能行！”

# for i in range(0,100,1):

# print("我能行")

2.

# for year in range(1,6,1):

# m = 10000*(1+0.003)**year

# print(m)

3.

# sum = 0

# for i in range(1,101,1):

# if i%3==0:

# sum += i

# print(sum)

# sum = 0

# for i in range(3,101,3):

# sum += i

# print(sum)

4.

# sum = 0

# for i in range(1,1001,1):

# if i%7!=0:

# sum += i

# print(sum)

# sum = 0

# for i in range(7,1001,7):

# sum += i

# print(500500 - sum)

5.

# sum = 0

# for i in range(10,21,1):

# sum+=i

# print(sum)

#sum = 0

# a = 10

# while a<=20:

# sum += a

# a += 1

# print(a,sum)

6.找出一个数的所有因子数

# a = int(input("请输入一个数："))

# for i in range(1,a//2+1):

# if a%i == 0:

# print(i)

7.

# a = int(input("请输入一个数："))

# flag = False #旗标法

# for i in ran

• 1
点赞
• 9
收藏
觉得还不错? 一键收藏
• 0
评论
12-06 1万+
10-21 2594
01-27 2万+
11-01 1053
05-27 5063
04-08 2083
10-27 630
11-11 7922

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、付费专栏及课程。