Only this week, get the SQL Complete Track of 9 courses in a special prize of $330 $89!
The for loop
The while loop
7. while loop – example
Nested loops
break and continue


Excellent! Apart from for loops, there are also while loops in Python. Let's first see them in action.


Run the template code and observe what happens.

As you can see, the while loop worked just like our for loop from the first example in this section: it printed 10 sentences to the output.