Posts

Showing posts from March, 2023

Loops in Python: While loop

Image
Many a times we will encounter a a situation where we have iterate over a group of statements until a specific condition is met. The number iterations that the loop should run is not fixed or known. In such cases, while loop is use.  Statements inside a while loop iterate until a given condition is true. Following is a simple example.