+ 1
Can someone explain what 'while true' and while false' mean? I mean while what is true?
Question
4 Answers
+ 5
BĆack JesusđŁ
If you have that all in a while True loop, considering you used proper syntax (all keywords are lowercase, indentation is correct, print statement was written correctly, etc.), it will run but will create an infinite loop, which wouldn't really be of much use if you're not breaking out of it
+ 3
while True is a loop that tests the value of the boolean value True, and because it will always satisfy the conditional for the loop, the loop will always run unless it encounters a break statement within it
while False will never run as the boolean value False will never satisfy the condition (while loops have to evaluate to True for them to run)
+ 3
It will endlessly run in silence giving you the impression that your device hangs and is unresponsive.