Understanding the code:
1. range(0, 6, 4)
-
This means: Start from 0, go up to (but not including) 6, and increment by 4.
-
So, it generates the numbers: 0 and 4.
2. Loop values:
The loop runs with:
-
i = 0
- i = 4
3. Inside the loop:
-
When i == 2: the continue statement would skip the rest of the loop and go to the next iteration.
-
But in this case, i is never 2, so continue is never executed.
4. print(i):
-
Since i is never 2, both 0 and 4 will be printed.
✅ Final Output:
PYTHON INTERVIEW QUESTIONS AND ANSWERS
https://pythonclcoding.gumroad.com/l/ylxbs
0 Comments:
Post a Comment