Home »
MCQs »
Python MCQs
An ___ statement has less number of conditional checks than two successive ifs
34. An ___ statement has less number of conditional checks than two successive ifs.
- if else if
- if elif
- if-else
- None of the mentioned above
Answer: C) if-else
Explanation:
A single if-else statement requires fewer conditional checks than two consecutives if statements. If the condition is true, the if-else statement is used to execute both the true and false parts of the condition in question. The condition is met, and therefore the if block code is executed, and if the condition is not met, the otherwise block code is executed.