Robotics & Artificial Intelligence
Distinguish between step loop and continuous loops.
Python Control Flow
3 Likes
Answer
The differences between step loop and continuous loop are:
| Continuous Loop | Step Loop |
|---|---|
| The control variable is updated (increased or decreased) only by 1 (one) after each iteration. | The control variable is updated by a given value (other than one) after each iteration. |
| The loop terminates when the control variable reaches the last limit. | The loop terminates when the value of the control variable reaches or exceeds the last limit of the range. |
Example: for n in range(1, 11): | Example: for n in range(1, 20, 2): |
Answered By
1 Like