Python groups code lines into blocks using indentation. When Python reads each line, it checks how far it is indented compared to previous lines. If the indentation increases, it starts a new block nested inside the previous one. If it stays the same, the line is part of the current block. If it decreases, Python closes one or more blocks. For example, in the code with if True and nested if False, the print("Hello") line is inside the first if block because it is indented. The print("No") line is inside the nested if block but does not run because the condition is False. The print("Done") line is not indented, so it runs outside all blocks. Mixing spaces and tabs can cause errors, so always use consistent indentation. This way, Python knows which lines belong together and runs the code correctly.