Line-by-line Explanation:
-
for i in range(3):
This means the loop will run with i taking values: 0, 1, 2. if i == 1:
When the value of i is 1, the condition becomes True.-
continue
This tells Python to skip the rest of the loop body for the current value of i and move to the next iteration. -
print(i)
This line is only executed if i is NOT 1.
Iteration Breakdown:
i = 0 → not equal to 1 → print(0)
i = 1 → equal to 1 → continue → skip print
i = 2 → not equal to 1 → print(2)
✅ Output:
Download : 500 Days Python Coding Challenges with Explanation
.png)

0 Comments:
Post a Comment