Python Programming - Conditional Statements - Discussion

Discussion Forum : Conditional Statements - General Questions (Q.No. 26)
26.
Which of the following is the correct syntax for a nested if statement?
if condition1:
    if condition2:
        # code block
if condition1:
    else:
        # code block
if condition1:
    elif condition2:
        # code block
if condition1:
    then condition2:
        # code block
Answer: Option
Explanation:
The correct syntax for a nested if statement is to use multiple if statements inside each other.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.