When to Use

When to use For loops v.s. While Loops

LoopUsage
ForUse when the number of iterations is computable before entering the loop, as when counting down from X to 0, printing a character N times, etc.
WhileUse when the number of iterations is not computable before entering the loop, as when iterating until a user enters a particular character.