Why setting lop_condition = False after printing



loop_condition = True

while loop_condition:
print "I am a loop"
loop_condition = False

When putting loop_condition = False there in the loop, is the purpose to stop the loop?

Replace this line with your code.


yes, this will updated loop_condition variable to false, so next looprun/iteration loop_condition evaluate to false, the loop ends


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.