while

While is a way of looping through lots of commands until the condition is fulfilled.

While True: is a way of repeating something indefinitely. It is like the forever loop in Scratch.
Many programmers would see this as bad code as there is no way to close the loop without closing the program.
You can see an example of this in the Pibrella Button Code

While used in a times tables generator
This would output as
While used in CVC word generator
Some of the output might look like this
After pod appeared the user clicked 1 and it was appended to the list.
After fuw the user clicked 3 and the program printed the real_words list and then stopped when it reached the while command.

Comments