“While loop” is the simplest form of loop in Python. But you need to understand it properly. Otherwise it can end up eating up your memory running the infinity loop. Usually most of the jobs are done by “for loop”. But in some special cases, you need to use “while loop”. A basic understanding is important.
While Loops
In plain English we often say, “While it is true it keeps on running. While it is not true it stops.” Logically, the same thing happens here. While a statement is true, the process is going on. You need a mechanism to stop that process. That is important. Otherwise that statement ...