Explanation:
range(5): Generates a sequence of numbers from 0 to 4 (inclusive).
- The for loop iterates through each of these numbers, assigning them one by one to i.
if i == 3: Checks if the current value of i is 3.
- If this condition is true, the continue statement is executed.
continue: When this statement runs, the current iteration of the loop is skipped, and the loop moves to the next number without executing the print(i) statement.
print(i): This prints the value of i only when i is not 3.
Output:
The code prints:
- The number 3 is skipped because of the continue statement. All other numbers (0, 1, 2, 4) are printed.