9/2/26Less than 1 minuteAbout 103 words
Concept: continue
The continue statement can be used to skip the rest of the code in the current iteration of a loop and move on to the next iteration.
This can be useful when certain cases must be skipped. Say you want to update the default shell of all users on a system, but you want to skip any user with the nologin shell. You could use a continue statement to skip those users and continue with the next user.
for i in range(100):
# Skip even numbers
if i % 2 == 0:
continue
print(i)