THE WORLD'S LARGEST WEB DEVELOPER SITE

Python ord() Function

❮ Built-in Functions


Example

Return the iteger that represents the character "h":

x = ord("h")
Run example »

Definition and Usage

The ord() function returns the number representing the unicode code of a specified character.


Syntax

ord(character)

Parameter Values

Parameter Description
character String, any character

Related Pages

Convert back to character with the chr() function.


❮ Built-in Functions