English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The ord() function returns an integer representing a Unicode character.
The syntax of ord() is:
ord(ch)
The ord() function takes a single parameter:
ch -Unicode character
The ord() function returns an integer representing a Unicode character.
print(ord('5)) # 53 print(ord('A')) # 65 print(ord('$')) # 36
Output result
53 65 36
By the way, the ord() function is withPython chr() functionThe opposite function