Python ord()

The ord() function returns an integer representing the Unicode character.

Example


ord() Syntax

The syntax of ord() is:

ord(ch)

ord() Parameters

The ord() function takes a single parameter:

  • ch - a Unicode character

ord() Return Value

The ord() function returns an integer representing the Unicode character.


Example: How ord() works in Python?

Output

53
65
36

By the way, the ord() function is the inverse of the Python chr() function.