Good job! Another keyword we can use in loops is
break terminates the entire loop,
continue skips the remainder of the current iteration. Take a look:
counter = 0
while counter < 10:
counter += 1
if counter == 3:
print('Current value:', counter)
The loop above will execute 10 times, but when the
counter value equals 3, the
continue keyword will immediately jump to the end of the current iteration.
In this case, the
print function will not show anything to the output for that iteration. As a result, we will see 9 lines printed instead of 10 –
Current value: 3 will be skipped.