From 1fd96b1ebcd42efecd2caa43ff6a1ad819757312 Mon Sep 17 00:00:00 2001 From: SirDickinson <44280186+SirDickinson@users.noreply.github.com> Date: Sat, 3 Nov 2018 21:22:52 -0500 Subject: [PATCH] Practical example of a while loop (#21523) * Practical example of a while loop Added a practical example of the benefits of a while loop being a condition controlled loop * Fixed syntax and grammar --- guide/english/python/while-loop-statements/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/english/python/while-loop-statements/index.md b/guide/english/python/while-loop-statements/index.md index a9c5a79ddcf..d769624512d 100644 --- a/guide/english/python/while-loop-statements/index.md +++ b/guide/english/python/while-loop-statements/index.md @@ -50,6 +50,8 @@ The code will then return to line 3 and repeat until days = > 7 As previously noted, a 'while' loop will run until the conditional logic is false. Because of this, it is important to set a "false" condition within the executable code. If no false is included, the while loop will run infinitely. Use caution when setting logic parameters to prevent the infinite loop unless that is the desired output. +Because `while` loops are conditioned controlled loops, they are great for programs that need to be run for an indefinite number of times. This allows for input to be taken time and time again until the condition is met. A good practical example would be for a game in which the player has the option to try again. Until the player responds with the response that meets the `while` loop condition, the player can continue to play the game, simulating the loop as many times as they please. + #### More Information: - Python `while` statement documentation