A boolean represents one of two logical states: True or False. Python produces booleans when conditions, string checks, and other predicates are evaluated. section 2.2.1 section 5.3.5
Use boolean results to make decisions, keep matching items, or report whether a condition was satisfied. Methods such as isalnum(), isalpha(), and isnumeric() return True or False. section 2.2.1 section 5.3.5
Checking for overlap
Convert lists to sets, find their intersection, and convert the result to a boolean when only the yes-or-no answer matters:\n\n```python\ngood_stocks_set & set(client0)\n# {'AMZN', 'GOOG'}\n\nbool(good_stocks_set & set(client0))\n# True\n```\n\nThe empty intersection would produce False because an empty collection evaluates as False. section 3.6.2
Keep these boolean behaviors distinct:
- Use `filter` when True keeps an item and False excludes it. section 5.3.5
- Remember that `or` and `and` use short-circuit evaluation and return one of their operands, rather than necessarily returning a boolean. section 3.6.5
- Treat `isnumeric()` carefully: floats, negative integers, and empty strings produce False. section 2.2.1
Table 9.1 JSON data types (view table figure)
| A special value (null) representing an empty value for any valid data type |
Compare Python booleans with JSON booleans: JSON writes the values as lowercase `true` and `false`. section 9.3.1










