The while Loop
The “while” loop is designed to repeat a set of commands as long as a test condition is true.
- The test condition may be simple or complex, just like with the “if” statement.
- If the test condition is false the first time that the loop is encountered, the loop body is never executed.
while Loop Examples