A while is a loop that as the condition that it is in is met, it will keep performing and action:

Here’s an example of that:

Screenshot from 2015-09-16 16:50:39

As long as the user doesn’t input the right number, the program will keep asking him to try again.

CC BY 4.0 Mastery 19: Use of loops with “while” by drag04 is licensed under a Creative Commons Attribution 4.0 International License.