In Python, conditional statements are critical for decision-making processes. These statements allow the program to choose different paths of execution based on the truth value of given expressions. The core conditional keywords in Python include `if`, `elif`, and `else`.
- The `if` statement is the starting point for decision-making. It executes a block of code if a specified condition is true.
- The `elif`, short for "else if", provides an additional condition that is checked only if the main `if` condition is false. You can have multiple `elif` statements to cater to different potential conditions.
- The `else` statement provides a default path of execution when all preceding conditions are false.
For example, in our exercise, we used these conditional statements to compare a `guess` with the `secret`:
```python
if guess < secret:
print('too low')
elif guess > secret:
print('too high')
else:
print('just right')
```
In this snippet, the program will print different outputs depending on the relative values of `guess` and `secret`.