Loops

A loop is a set of statements that are repeated until a specific condition is met. We will look at two types of loops: the for loop, and the while loop.

For loop

A for loop executes a set of statements for each item in a sequence such as a list or string or a range.

video

While loop

A while loop executes a set of statements while a certain condition is true.

video

Read page 47 – 52 of the textbook “Python for Beginners”.