Informatics Practices

Assertion (A): The conditional flow of control is implemented using if statement.

Reasoning (R): A statement or statements (block of code) are indented (usually 4 spaces) inside the if statement and are executed only if the condition evaluates to true, otherwise they are ignored.

  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

2 Likes

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

2 Likes


Related Questions