0Pricing
Python For Kids · Lesson

If-Else Statements

Learn decision-making using if, else, and elif.

1

If-Else Statements

Welcome to the Control Flow lesson! Today, we'll learn how to make decisions in your Python programs using if, else, and elif statements.

If-Else Statements — illustration 1

2

What are If-Else Statements?

If-Else statements allow your program to choose different paths based on certain conditions. It's like making decisions: "If this happens, do that; otherwise, do something else."

  • If: Checks a condition and executes code if it's true.
  • Else: Executes code if the if condition is false.
  • Elif: (Else If) Checks another condition if the previous if was false.

All lessons in this course

  1. If-Else Statements
  2. Loops in Python
  3. Nested Loops
  4. Break and Continue
← Back to Python For Kids