Name

ord

Synopsis

ord(ch)

Returns the ASCII/ISO integer code between 0 and 255 (inclusive) for the single-character string ch. When ch is Unicode, ord returns an integer code between 0 and 65534 (inclusive). See also chr and unichr in this section.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.