Step 1: for i in range(7)
range(7) generates numbers from 0 to 6.
-
So the loop runs with i = 0, 1, 2, 3, 4, 5, 6.
Step 2: if i < 3: continue
continue means skip the rest of the loop and go to the next iteration.
-
Whenever i < 3, the loop skips printing.
So:
-
For i = 0 → condition true → skip.
-
For i = 1 → condition true → skip.
-
For i = 2 → condition true → skip.
Step 3: print(i, end=" ")
-
This line runs only if i >= 3 (because then the condition is false).
-
It prints the value of i in the same line separated by spaces (end=" ").
Final Output
๐ 3 4 5 6
✨ In simple words:
This program skips numbers less than 3 and prints the rest.


0 Comments:
Post a Comment