【发布时间】:2015-11-23 15:34:32
【问题描述】:
for i in range (0, 81):
output = send command
while True:
last_byte = last_byte - offset
if last_byte > offset:
output = send command
i+
else:
output = send command
i+
break
我想在每次执行发送命令时增加迭代器。现在它只在执行 for 循环时增加一。请指教
for i in range(0,10):
print(i)
i +=2
print("increased i", i)
我运行了这段代码,它产生了从 0 到 9 的结果。我原以为它会将迭代器增加 2。
【问题讨论】:
标签: python python-3.x for-loop iterator