Do you have to add extra indentation to conditional statements in a function body?

No

Yes

Only if the conditional statement is the last statement in the function.

Only if the conditional statement comes first in the function.

It is recommended to add extra indentation to conditional statements in a function body to improve readability and make the code easier to understand. So the answer is Yes.

Your correct ty

Yes, you have to add extra indentation to conditional statements in a function body.

The correct answer is: No, you do not have to add extra indentation to conditional statements in a function body.

In most programming languages, including Python, indentation is used to indicate the grouping of statements. However, the indentation level within a function is determined by the overall structure of the function, not by individual conditional statements.

Conditional statements, such as if-else or switch statements, are introduced within the function body and are indented at the same level as the rest of the statements in the function. This consistent indentation throughout the function helps maintain the readability and structure of the code.