# If ... Else — Python Fundamentals: From Basics to Async

Source: https://www.skillbyai.com/en/python/py-if-else

> Branch with if, elif and else, understand truthy and falsy values, and write conditional expressions.

## if / elif / else

Note the colon and the indented block. Python uses `elif`.

```python
if temp > 25:
    print("Warm")
elif temp > 10:
    print("Mild")
else:
    print("Cold")
```

## Truthiness

Falsy: `False`, `None`, `0`, `""`, `[]`, `{}`, `set()`. Everything else is truthy — so `if items:` checks non-emptiness.

## Conditional expression

`label = "even" if n % 2 == 0 else "odd"`
