Home »
MCQs »
Python MCQs
Amongst which of the following if syntax is true?
23. Amongst which of the following if syntax is true?
-
if condition:
#Will executes this block if the condition is true
-
if condition
{
#Will executes this block if the condition is true
}
-
if(condition)
#Will executes this block if the condition is true
- None of the mentioned above
Answer: A)
if condition:
#Will executes this block if the condition is true
Explanation:
If is a keyword which works with specified condition. If statement in Python has the subsequent syntax:
if condition:
#Will executes this block if the condition is true