KnowledgeBoat Logo

Class - 12 CBSE Computer Science — Assertion Reason Type Questions

Assertion (A): The conditional flow of control can be defined with the help of if statement.

Reasoning (R): if statement executes one or more statements based on the given condition. If the condition evaluates to true, the statement block following the indentation gets executed, otherwise nothing gets executed.

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

Python Control Flow

1 Like

Answer

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

Explanation
The if statement in Python allows conditional flow of control. It evaluates a condition and executes one or more statements based on whether the condition is true or false. If the condition evaluates to true, the statement block following the if statement (indented code) gets executed, otherwise, if the condition is false, that block is skipped, and the program continues with the next statement after the if block.

Answered By

3 Likes