Python has a powerful conceptcalled loops.Loops makes use of called looping (iteration), which helps cut out our repetitive code. This is very helpful when you want to do something times simply write the initial code then you can repeat multiple times till a particular condition will not met.The purpose of loops is to repeat the same, or similar, code several times. This number of times could be specified to a certain number, or the number of times could be dictated by a certain condition being met.

A conditional loop has the potential to become an infinite loop when nothing in the loop’s body can affect the outcome of the loop’s conditional statement. The While loop and the For loop are the two common types of conditional loops. You can also provide a numerical range(sequence) of values to control how many times the code will execute.


Introduction to the loops in Python
2.25 GEEK