Looping on a Condition
A for loop walks a collection. You know how many passes there will be before it starts.
A while loop repeats as long as a condition stays true. You don't know the count in advance: keep asking until they enter a valid answer, keep withdrawing until the balance runs out, keep playing until someone wins.
Mark this lesson complete
Signed in, your progress follows you to every device.