Informatics Practices
Assertion (A): When a Python code is unable to accept an input, it results in runtime error.
Reasoning (R): Runtime error arises due to incorrect statement that results in no output.
- 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.
Python Control Flow
1 Like
Answer
A is true but R is false.
Explanation
When a Python code is unable to accept an input, it results in a runtime error. Runtime errors arise due to issues that occur while the program is running, such as attempting to use invalid operations on data types. In contrast, syntax error arises due to incorrect statement that results in no output.
Answered By
2 Likes
Related Questions
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.
- 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.
Assertion (A): In an if-else statement, the if block checks the true part whereas else checks for the false part.
Reasoning (R): In a conditional construct, else block is mandatory.
- 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.
Assertion (A): break and continue are termed as Jump statements.
Reasoning (R): Jump statements can only be used with looping constructs but not with conditional constructs.
- 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.
Assertion (A): The range() method is used with both for and while loops.
Reasoning (R): By default, the values for start and step are 0 (zero) and 1 (one), respectively.
- 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.