chr() and ord()

Built-in functions that convert between a character and its Unicode code point: ord('A') is 65 and chr(65) is 'A'.

In more detail

ord takes a string of exactly one character and returns an integer; chr does the reverse. Because letters have consecutive code points, chr(ord('a') + 1) is 'b'.

Related terms

Taught in

References

Certification courses