Fish 1 Fish 2 Fish 3 Fish 4

Lesson 3: Introduction to Conditions

In this lesson, you'll learn how to use conditions (if statements) to control the flow of your program based on different scenarios.

What is a Condition?

A condition allows the program to decide what action to take based on whether something is true or false. Let’s see an example:

Example in Python:

                age = 18
                if age >= 18:
                    print("You are an adult")
                else:
                    print("You are a minor")
            

Your Task:

Try writing a condition in your Python environment. You can use the code above and change the age to see how the result changes!

Watch the Video:

Quiz: Test Your Knowledge!

What is the correct way to write an if condition in Python?

Select an answer to check if you're correct!

© 2025 Ocean Explorer | All Rights Reserved