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:

  1. The colon (:) is significant and required. It separates the header of the compound statementfrom the body.
  2. The line after the colon must be indented. It is standard in Python to use four spaces for indenting.
  3. All lines indented the same amount after the colon will be executed whenever the BOOLEAN_EXPRESSION is true.

Example:

Source: http://www.openbookproject.net/books/bpp4awd/ch04.html