Skip to content

Decision Making¶

About This Lesson¶

Learn to control program flow with conditional statements. Master if, elif, and else statements to make your code respond to different conditions.

What You'll Learn¶

  • if statements
  • if-else statements
  • if-elif-else chains
  • Nested conditionals
  • Ternary operators
  • Boolean expressions in conditions
  • Use the MkDocs navigation on the left to move between lessons
  • The notebook below is fully interactive - you can run and edit code
  • Your changes are saved in your browser's local storage

Interactive Notebook¶


Having trouble with the embedded notebook? Try one of these: