Have you ever noticed that hyperlinks change color after you click them? If the link has been clicked, then the web browser renders it in purple, rather than blue. The programming concept that makes this possible is called conditionals.

This might be a simple example, but conditionals underlie the complex behavior of computer programs from Gmail, to Mario games, to Microsoft Office. Conditionals make it possible for programs to decide how to react to a wide variety of situations.

But computers aren’t intelligent—in order for them to make decisions they have to be programmed with a set of rules to follow.

In this lesson, we’ll explore how we write programs that can make decisions with conditionals.


Move on when you’re ready to learn more!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?