From af0fda48912a10fc0ccfae7becacbbd92b5d754e Mon Sep 17 00:00:00 2001 From: Blake Lambert <36992974+curiouscoding22@users.noreply.github.com> Date: Thu, 25 Oct 2018 09:59:01 -0400 Subject: [PATCH] Infinite loop situation (#25657) Added additional information on creating infinite loops. --- guide/english/python/while-loop-statements/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guide/english/python/while-loop-statements/index.md b/guide/english/python/while-loop-statements/index.md index ac128d3342..c7026a1b2c 100644 --- a/guide/english/python/while-loop-statements/index.md +++ b/guide/english/python/while-loop-statements/index.md @@ -48,6 +48,10 @@ Line-by-Line Explanation of the above CODE: 9. Since the variable days is equal to 1 which is less than 7 so the while loop is executed again. 10. It goes on again and again and when the console prints 'Today is Sunday' the variable days is now equal to 7 and the while loop stops executing. +## Infinite Loops: + +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. + #### More Information: - Python `while` statement documentation