KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Assertion (A): Loop is a repetitive structure in which a statement or a set of statements are executed until the desired number of iterations is over.

Reason (R): The for loop is used to repeat the execution of a block of statements for a fixed number of times.

Based on the above assertion and reasoning, pick an appropriate statement from the options given below:

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true and R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
  5. Both A and R are false.

Python Control Flow

3 Likes

Answer

Both A and R are true and R is not the correct explanation of A.

Reason — A loop is a repetitive structure used to execute statements repeatedly until the required number of iterations are over. The for loop is one type of loop that is used when the number of iterations is fixed. Therefore, both statements are true, but the second statement does not explain the first statement.

Answered By

2 Likes


Related Questions