The ord()
function is one of Python's built-in functions that returns the Unicode code point of a single character. It takes one argument - the character whose Unicode code is to be retrieved.
Here's an example:
print(ord('A')) # 65
print(ord('a')) # 97
print(ord('0')) # 48
print(ord('$')) # 36
print(ord('你')) # 20320
print(ord('好')) # 22909
ord()
is the inverse function of chr()
.
See also: