A Boolean context evaluates an object as true or false so Python can choose a control-flow path or conditional result. Empty sequences and empty strings evaluate as false; nonempty values evaluate as true. section 4.7 section 5.9
Use Boolean contexts to write direct guards instead of explicit length or equality checks:
- Use `if not items` to detect that a variadic argument tuple is empty before indexing its first element. section 4.7
- Use `if not city_name` to detect an empty input string and terminate or skip the current loop iteration. section 5.9
- Prefer truth-value tests over checking sequence length or comparing directly with `()`. section 4.7
Guarding input and arguments
A function can begin with `if not items:` before reading `items[0]`; an input loop can use `if not city_name:` to reject an empty city name. section 4.7 section 5.9

