What does "while true" and "while false" mean exactly ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does "while true" and "while false" mean exactly ?

12th Mar 2017, 2:33 AM
sriranga
2 Answers
+ 3
while loops run in the format of: While condition do code where the code will run if the condition is true. In the case of a while true loop, the condition is always true and hence always runs (infinite loop). while false will simply skip the code inside the loop. while true loops can still be used, with a break statement to get out of them.
12th Mar 2017, 7:07 AM
Rrestoring faith
Rrestoring faith - avatar
0
in python
12th Mar 2017, 2:34 AM
sriranga