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

ord

Prev: open | Up: __builtins__ | Next: pow
Rel: ascii, bin, chr, format, hex
Ref: docs.python.org — ord
Tags: #public #python3 #builtins


Import & Availability

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

Overview & Signature

ord(character, /)

Return the ordinal value of a character.

Usage

assert ord("A") == 65
assert ord("€") == 0x20AC

Gotchas

REPL Inspect

help(ord)

Linked from

Related notes