Computer Science
In Python, which of the following will create a block in a compound statement?
- colon
- statements indented at a lower, same level
- indentation in any form
- {}
Related Questions
What abandons the current iteration of the loop?
- continue
- break
- stop
- infinite
An empty/null statement in Python is:
- go
- pass
- over
- ;
Assertion (A): When a set of statements is indented under the same block, starting from the same indentation, it is said to be a compound statement.
Reasoning (R): Compound Statement begins with a header ending with a colon (:) sign and the statements under the same indentation are marked as a block.
- 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 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.