我应该修改一个程序,以便循环在 3 次迭代后停止。这是一个非终止循环,但我改变了它,现在它根本没有出现。你能看出我做错了什么吗?
i = 1
while_iterations = 1
while (i <= 3):
print("Starting while iteration number", while_iterations)
for number in range(5, 10):
if (number % 2 == 1):
print("Found an odd number: ", number)
else:
print(number, "is not an odd number")
print("End of for loop.")
print()
while_iterations = while_iterations + 1
i=i+1