loop

Loops are traditionally used when you have a block of code which you want to repeat. The Python for statement iterates over the members of a sequence in order, executing the block each time. For loops are traditionally used when you have a block of code which you want to repeat a fixed number of times. The Python for statement iterates over the members of a sequence in order, executing the block each time. Contrast the for statement with the ''while'' loop, used when a condition needs to be checked in each iteration, or to repeat a block of code forever.

» Glossary of terms