FireEdgeX
0

LESSON 03 ยท PYTHON

If statements

Indentation marks the blocks that run for each branch of a decision.

7 min readIn progress

THE IDEA

Understand the concept

Python uses if, elif, and else to select a path based on a condition. Consistent indentation is part of the language syntax, so statements indented under a branch belong to that branch.

WORKED EXAMPLE

See it in context

Example