Else Statements

An if clause can optionally be followed by an else Statement. The else clause is executed only when the if statement’s condition is False.

else statement always consists of the following:

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