True Boolean true
Last updated: 2026-09-22
True Boolean true
True is the sole true instance of the bool type.
| Category | Keywords & Statements |
|---|---|
| Kind | Keyword / Statement |
| Python Version | all |
📝 Syntax
True
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
True
True
True
ℹ️ Info True is a subclass of int: True == 1.
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QAre `True` and `1` equal?
A`True == 1` is `True`, because `bool` is a subclass of `int`. But `True is 1` is `False` — they are different objects. For logical judgments use the `True`/`False` literals, not `1`/`0`.
QWhy is `True + True` equal to 2?
ABecause `bool` inherits from `int`, so `True` counts as 1 in arithmetic. This is usually not good style; booleans are meant for logic, not numeric computation.
QWhich values count as «true» in a condition?
AAside from `0`, `0.0`, empty strings, empty lists/tuples/dicts/sets, `None`, and `False`, almost every object is truthy. For example, `not []` is `True` while `not [1]` is `False`.