can somebody describe the "while true" statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

can somebody describe the "while true" statement

14th Oct 2016, 1:52 PM
Shahzeb Sheikh
Shahzeb Sheikh - avatar
2 Answers
+ 10
"while condition:" repeats the instructions in the block while the condition is true. Using "while True:" allows you to loop the execution of the block indefinitely. You can still use break to break out of the loop, but otherwise this is what is called an infinite loop.
14th Oct 2016, 1:58 PM
Zen
Zen - avatar
+ 1
awesome thanks
14th Oct 2016, 1:59 PM
Shahzeb Sheikh
Shahzeb Sheikh - avatar