# If ... Else — Python

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

> Branching with elif and truthiness.

## 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"`
