If Statements

An if statement will execute the clause when it’s condition evaluates to True.

If this condition is true, execute the code in the clause.

If statements consist of:

  • The if keyword
  • A condition
  • A colon
  • Starting on the next line, and indented block of code.
if name == 'Alice':
    print('Hi, Alice.')