Robotics & Artificial Intelligence

Which of the following loop does not need to check the condition before the execution begin?

  1. User controlled loop
  2. for
  3. while loop
  4. all

Python Control Flow

2 Likes

Answer

for

Reason — The for loop works with a predefined sequence or iterable, so the number of iterations is fixed in advance unlike the while loop which depends on a condition.

Answered By

2 Likes


Related Questions