What can we do with the while statement?
We can make computer repeat the commands as long as a condition’s expression gets true value.
What value needs the statement in the brackets evaluate to in order for the loop to continue?
“True”
What is an infinite loop?
Loops that executes forever as long as the expressions get evaluated to true and while there’s no any update on the expression value.
What is an iteration?
A loop execution
When is it a good idea to use a for statement (do a for loop) instead of the while loop we learned previously?
When we need define, initialize, test, and change the value of loop variables easily.
How would you write a for-loop in code?
for (init-statement; condition; end-expression)
statement
What is an off-by-one error?
Programmer misses the last iteration also must be counted by the times of condition value by using < or > operater instead of <= or >=, the loop iterates one too many or one too few times.