¡Sorpréndeme!

Lecture 58: Python has keywords as Continue Break Pass

2025-05-20 7 Dailymotion

The keywords continue, pass, and break serve distinct purposes in controlling the flow of loops and conditional statements in Python.
Continue: When encountered within a loop (for or while), the continue statement skips the rest of the current iteration and proceeds to the next iteration.
for i in range(10):
if i % 2 == 0:
continue # Skip even numbers
print(i) # Prints only odd numbers: 1, 3, 5, 7, 9
pass: The pass statement is a null operation; it does nothing. It acts as a placeholder where a statement is syntactically required but no action needs to be performed.