if 0 == x:
if y == 10:
print("Yes")
if 0 == x:
if y == 10:
print("Yes")
if 0 == x:
if y == 10:
print("Yes")
if 0 == x:
if y == 10:
print("Yes")
Ok, let’s apply simple indentation logic.
When you have an if statement (for example), it will execute everything which immediately follows which is indented by four spaces, subject to the condition in the statement.
Going through the statements in order:
Nothing is indented, so both conditional statements are meaningless. There is no code which is conditional on either if statement. The print statement will be executed regardless.
Both indented lines will be executed if the first if statement is true. The second if statement is meaningless as there is no code which is conditional on it.
The first if statement is meaningless as there is no indented code which directly follows it. The print statement will execute if the second if statement is true.
If the first if statement is true, the second will be executed. If the second is true also, the print statement will be executed.