On this page
  1. True
  2. Import & Availability
  3. Overview & Signature
  4. Usage
  5. Gotchas
  6. REPL Inspect

True

Prev: NotImplemented | Up: __builtins__ | Next: abs
Rel: False, None, Ellipsis, NotImplemented, copyright
Ref: docs.python.org — True
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import True

Overview & Signature

True -> bool

Returns True when the argument is true, False otherwise.

Usage

assert True == 1 and isinstance(True, int)
assert sum([True, False, True]) == 2   # handy for counting truthy conditions

Gotchas

REPL Inspect

help(True)

Linked from

Related notes