Learn
Loops
Condition
The condition is the expression that decides whether the loop is going to continue being executed or not. There are 5 steps to this program:
The
loop_condition
variable is set toTrue
The
while
loop checks to see ifloop_condition
isTrue
. It is, so the loop is entered.The
print
statement is executed.The variable
loop_condition
is set toFalse
.The
while
loop again checks to see ifloop_condition
isTrue
. It is not, so the loop is not executed a second time.
Instructions
1.
See how the loop checks its condition, and when it stops executing? When you think you’ve got the hang of it, click Run to continue.