我想要一个增量为10的while循环,而不必在python中重复起始数字。这就是我所做的,并且得到的结果是,我在下面写下了所需的结果以进行进一步的说明。谢谢。
limitstart = 0
limitend = 0
while limitstart < 55:
limitstart = limitend
limitend = limitstart + 10
print (limitstart)
print (limitend)
print ("new batch")
这是我的结果。
0
10
new batch
10
20
new batch
20
30
new batch
30
40
new batch
40
50
new batch
50
60
new batch
new batch
60
70
new batch
我想要的结果是:
1
10
new batch
11
20
new batch
21
30
new batch
31
40
new batch
41
50
new batch
51
55