Back Navigation Next Navigation Video 5: Conditionals (page 7 of 10)

Python also supports nesting conditionals where one conditional may be nested within another. The key with nesting conditionals is to get the indentation correct so the interpreter knows which blocks of code to execute when the nested expressions are evaluated to True or False.

Conditionals

We can have an unlimited number of nested conditionals but we want to make sure our code is readable. Therefore, we may consider modifying our code after three or four nested levels of conditionals.