How to use While loop in python
1 min readSep 10, 2021
How to use While Loop In python
In these tutorials we will start the loop topics, in these tutorials we will learn the while loop.
While loop is used to ignore the same code write again and again. For Example when we write 100 times one message then we can use a loop that can help us and we can write only one line code and repeat that code 100 times.
Syntax of While-loop
while(Here we can write condition like a>10)
{
Here we can write the program which we want statement(s);
increment / decrement
}
How while loop works
In While loop first, check the condition if the condition is true then it can execute the program then we can use the increment and decrement for the program which type you want When the condition has become false then it jumps from the loop and executes the next line which is present outside of the loop.