Conditionals are control flow structures that allow a program to make decisions based on the evaluation of one or more conditions.
Conditionals allow us to create branches in the program’s flow, executing certain instructions only if a specific condition is met.
Conditionals are essential for programming. In fact, they are the foundation of programming. Without conditionals, programs would be a flow of instructions executed from start to finish. We could only make “calculators”.
Thanks to conditionals, a program can be like one of those games or books where we have to make decisions. Depending on the decision we make, we can have one ending or another.
Well, thanks to conditionals, our program can have many possible execution paths and many possible “endings”.
We can represent a conditional using the following symbol, which is more or less standard in flowcharts.

Understanding Conditionals
Conditionals are easy-to-understand structures. In fact, we use them constantly in our daily lives. For example, when we do.
If it rains, then I take an umbrella
In this case, we are dealing with a simple conditional. If the condition is met (it rains) we take the umbrella. If not, we do nothing. We could represent it like this.

This type of conditional is usually called IF, and in code it would look something like this,
if it rains:
// take umbrella
Another example of a conditional could require an alternative action. This action will only be executed if the condition is not true. For example,
If it rains, then I take an umbrella
If not, I take a cap.
In this case, besides having an action if the condition is met, we have an action to perform if the condition is not met.

We call this type of structure IF-ELSE, and seen in code it would be something like this.
if it rains:
// take umbrella
else:
// take cap
Types of Conditionals
In programming, these and other types of conditionals usually exist. The most common are:
