Next / Previous / Contents / TCC Help System / NM Tech homepage

13.26. ord(): Find the numeric code for a character

Given a string s containing a single character, ord(s) returns that character's numeric code. Compare Section 13.5, “chr(): Get the character with a given code”.

>>> ord('A')
65
>>> ord('\x00')
0