Use the while when you want a code block to repeat n times, using a simplier conditional checker.
number = 0
while (number < 10)
While the conditional is true, the code block will be executed. Note that inside the block we are executing a code (number++) that will make us exit the loop (making the "number < 10" to be false in the future).