如何在嵌套的if/else语句中执行流程?

Syg*_*cal -3 python if-statement

如果我有两个if语句然后是else,我怎么知道else适用哪个if语句?是缩进吗?比如这个,

if x == 2:
    if y == 3:
        x = y
else:
    y = x
Run Code Online (Sandbox Code Playgroud)

else引用哪个if语句?

Avi*_*Raj 6

else适用于第一个if语句,请参见缩进.