Iteration (looping) means being able to execute a block of code a number of times.
This is useful if you want to run the same code over and over again, each time with a different value. Iteration is really useful when you are working with arrays.
Python has two loop structures:
|For Loop||simple for loop controlled by a numeric variable|
|For loop with 2D List||Print a 2D list using a for loop|
|While Loop||Loop While a condition is true |
Notes: the condition is tested at the beginning of the loop and the code may not get executed
|While Else Loop||Loop While a condition is true, with an else clause after the loop has completed|