There are a number of differing looping constructs available in Python, though for and while loops are the dominant ones. Generally speaking, loops allow a program to perform the same operation multiple times until a condition occurs that cancels the loop. Along with if...else statements, loops handle a large portion of program logic.
Loops
while loops
The while loop is a standard workhorse of many languages. Essentially, the program will continue doing something while a certain condition exists. As soon as that condition is no longer true, the loop stops.
break and continue work exactly the same as in C. The equivalent of C's empty statement (a semicolon) is the pass statement, and Python includes an else statement for...