Back Navigation Next Navigation Conceptual Review (page 21 of 55)

The Python interpreter knows what code to execute in a conditional based on the ":" at the end of the Boolean expression and the spaces, tabs or indents after the ":". Spaces, tabs, or indents are key. If you have the spaces wrong, then the interpreter may get confused resulting in a logic or traceback error.

The PEP8 (Python's style guide) recommends always using 4 Spaces per Indentation Level. Doing so will help us ensure readability of our scripts. Notice the ":"s and indentations in the below snippet.

Conditionals