Why setting lop_condition = False after printing


#1



https://www.codecademy.com/courses/python-beginner-en-cxMGf/0/2?curriculum_id=4f89dab3d788890003000096

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.


#2

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


#3

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