CBSE Class 11 Computer Science
Question 2 of 80
Conditional and Looping Constructs — Question 2
Back to all questions 2
Question Assertion (A): The conditional flow of control is implemented using if statement.
Reasoning (R): if statements can only be used to execute a single statement or a block of statements if a certain condition is true.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
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.