A while loop allows you to repeatedly execute a block of code while a certain condition is true. You can use the break statement to exit the loop prematurely, and the continue statement to skip to the next iteration of the loop without executing the rest of the code in the current iteration.
A for loop allows you to execute a block of code the same number of times as there are elements in an iterable sequence. The range() function is useful for creating a defined iterable sequence. And nested loops are loops within loops that give you even greater power and control over how your code may execute.
students = [['Igor', 'Sokolov'], ['Riko', 'Miyazaki'], ['Tuva', 'Johansen']]
for student in students:
for name in student:
print(name)
print()
for even_num in range(2, 11, 2):
print(even_num)