Python Ord() Function - W3Schools

Python ord() Function

❮ Built-in Functions

Example

Return the integer that represents the character "h":

x = ord("h") Try it Yourself »

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

+1 Track your progress - it's free! Log in Sign Up

Từ khóa » Hàm Ord