关于Python中if嵌套使用的有关问题

关于Python中if嵌套使用的问题
新手刚学Python。老师在课上讲Monty Hall写了这么一段代码,
for _ in range(nb_of_runs):
    doors = ['A', 'B', 'C']
    winning_door = choice(doors)
    print('User does not know, but car happens to be behind door {}'.format(winning_door))
    first_choice = choice(doors)
    print('User chooses door {}'.format(first_choice))
    doors.remove(winning_door)
    if first_choice == winning_door:
        opened_door = choice(doors)
        if switches:
            doors.remove(opened_door)
            second_choice = doors[0]
    else:
        doors.remove(first_choice)
        opened_door = doors[0]
        if switches:
            second_choice = winning_door

请问这里面为什么else对应的是if first_choice == winning_door的if,而不是后面那个if switches的if?
------解决思路----------------------
python是严格的格式要求,如果是在同一列上就是配对的
------解决思路----------------------
python是靠缩进实现块的  所以是的