ord()
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”.
s
ord(s)
chr()
>>> ord('A') 65 >>> ord('\x00') 0