Home »
MCQs »
Python MCQs
In Python, an else statement comes right after the block after 'if'?
27. In Python, an else statement comes right after the block after 'if'?
- True
- False
Answer: A) True
Explanation:
After the 'if' condition, an else statement is placed immediately after the block. if-else statements are used in programming in the same way that they are used in the English language. The following is the syntax for the if-else statement:
if(condition):
Indented statement block for when condition is TRUE
else:
Indented statement block for when condition is FALSE