0
What is the purpose of making an infinite While loop? someone could give me an exemple of application?
2 Réponses
+ 2
If you wanted something to constantly be checked in the background you could set up a value like x = 5 and then while x = 5 do whatever check you want, get it to pause for 30 seconds and then it would execute again. You could monitor wifi signal or check hard drive storage or something like that. It wouldn't be a good or efficient usage of a while loop, but it would be an application.
+ 1
Just a comment about Daniel's answer: a shorthand and more effective way to create an infinite loop is "while True"