Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL

L

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.