KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Which of the following loop does not execute even once, if the condition is false in the beginning?

  1. infinite
  2. while
  3. for
  4. none

Python Control Flow

1 Like

Answer

while

Reason — The while loop checks the condition before executing the loop body. If the condition is false at the very beginning, the control will not enter the loop block and hence the loop will not execute even once.

Answered By

1 Like


Related Questions