--Originally published at Start in the world of the #TC101
In order to write useful programs, we almost always need the ability to check conditions and change the behavior of the program accordingly.
A few important things to note about if statements:
- The colon (:) is significant and required. It separates the header of the compound statementfrom the body.
- The line after the colon must be indented. It is standard in Python to use four spaces for indenting.
- All lines indented the same amount after the colon will be executed whenever the BOOLEAN_EXPRESSION is true.
Example: