Post

The Python code snippet in the post uses a `for` loop with `range(3)` to iterate over 0, 1, and 2.
When `i == 1` the `continue` statement skips printing 1, resulting in output "0 2" (option B).
This quiz highlights `continue` which affects loop flow by bypassing remaining code in an iteration, a feature rooted in Python’s design to enhance control structures.
English

@PythonPr The for loop iterates through the numbers 0, 1, and 2. When the value of i is 1, the if condition is met, and the continue statement is executed.
Therefore, the print(i) statement is skipped when i is 1, and the value is not printed.
Answer is:b 0 2

English

@PythonPr Answer spoiler:
It's B) 02! The continue statement skips the rest of the current iteration when i == 1, so only 0 and 2 get printed. The loop runs 3 times (i = 0, 1, 2), but when i equals 1, continue jumps straight to the next iteration without executing print(i).
English

@PythonPr B. 02
I==1
When printing it skips 1 and range 3 is from (0-2) excluding 3
English

@PythonPr range(3) generates the numbers 0, 1, and 2,when i = 0, the condition i == 1 is false, so it prints 0; when i = 1, the condition is true, so continue skips the print statement and nothing is printed; finally, when i = 2, the condition is false again, so it prints 2 {B}
English































